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:
Allan Caplan
2007-01-29 18:09:16 +00:00
parent 7e26a9c1dc
commit bfc8b24bd2
3 changed files with 5 additions and 6 deletions

View File

@ -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();

View File

@ -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

View File

@ -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);
}
}