forked from phoedos/pmd
Checking in some Java 5 changes
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5007 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -58,12 +58,11 @@ public class ClassTypeResolver extends JavaParserVisitorAdapter {
|
||||
* @param node
|
||||
*/
|
||||
private void populateImports(ASTCompilationUnit node) {
|
||||
List theImportDeclarations = node.findChildrenOfType(ASTImportDeclaration.class);
|
||||
List<ASTImportDeclaration> theImportDeclarations = node.findChildrenOfType(ASTImportDeclaration.class);
|
||||
importedClasses = new HashMap<String, String>();
|
||||
|
||||
// go through the imports
|
||||
for (Iterator anIterator = theImportDeclarations.iterator(); anIterator.hasNext();) {
|
||||
ASTImportDeclaration anImportDeclaration = (ASTImportDeclaration) anIterator.next();
|
||||
for (ASTImportDeclaration anImportDeclaration : theImportDeclarations) {
|
||||
if (!anImportDeclaration.isImportOnDemand()) {
|
||||
String strPackage = anImportDeclaration.getPackageName();
|
||||
String strName = anImportDeclaration.getImportedName();
|
||||
|
@ -21,7 +21,7 @@ public class LooseCoupling extends AbstractRule {
|
||||
}
|
||||
|
||||
public Object visit(ASTClassOrInterfaceType node, Object data) {
|
||||
Node parent = node.jjtGetParent().jjtGetParent().jjtGetParent();
|
||||
Node parent = node.getNthParent(3);
|
||||
Class clazzType = node.getType();
|
||||
boolean isType = CollectionUtil.isCollectionType(clazzType, false);
|
||||
if (isType
|
||||
|
@ -138,8 +138,8 @@ public class PMDASMVisitor implements ClassVisitor {
|
||||
|
||||
private void addTypes(String desc) {
|
||||
Type[] types = Type.getArgumentTypes(desc);
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
addType(types[i]);
|
||||
for (Type type : types) {
|
||||
addType(type);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user