From 2ed04a9118460290c05104a1cb5bb78bbcc8cd8b Mon Sep 17 00:00:00 2001 From: Brian Remedios Date: Tue, 10 Oct 2006 04:55:19 +0000 Subject: [PATCH] Vector -> ArrayList & import cleanup git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4613 51baf565-9d33-0410-a72c-fc3788e3496d --- .../sourceforge/pmd/rules/CloseResource.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/pmd/src/net/sourceforge/pmd/rules/CloseResource.java b/pmd/src/net/sourceforge/pmd/rules/CloseResource.java index ee96ceeca9..2076f5805e 100644 --- a/pmd/src/net/sourceforge/pmd/rules/CloseResource.java +++ b/pmd/src/net/sourceforge/pmd/rules/CloseResource.java @@ -3,11 +3,17 @@ */ package net.sourceforge.pmd.rules; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.StringTokenizer; + import net.sourceforge.pmd.AbstractRule; import net.sourceforge.pmd.ast.ASTBlock; import net.sourceforge.pmd.ast.ASTClassOrInterfaceType; import net.sourceforge.pmd.ast.ASTCompilationUnit; -import net.sourceforge.pmd.ast.ASTImportDeclaration; import net.sourceforge.pmd.ast.ASTLocalVariableDeclaration; import net.sourceforge.pmd.ast.ASTMethodDeclaration; import net.sourceforge.pmd.ast.ASTName; @@ -17,13 +23,6 @@ import net.sourceforge.pmd.ast.ASTType; import net.sourceforge.pmd.ast.ASTVariableDeclaratorId; import net.sourceforge.pmd.ast.Node; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import java.util.StringTokenizer; -import java.util.Vector; /** @@ -56,7 +55,7 @@ public class CloseResource extends AbstractRule { public Object visit(ASTMethodDeclaration node, Object data) { List vars = node.findChildrenOfType(ASTLocalVariableDeclaration.class); - List ids = new Vector(); + List ids = new ArrayList(); // find all variable references to Connection objects for (Iterator it = vars.iterator(); it.hasNext();) { @@ -94,7 +93,7 @@ public class CloseResource extends AbstractRule { ASTBlock top = (ASTBlock) n; - List tryblocks = new Vector(); + List tryblocks = new ArrayList(); top.findChildrenOfType(ASTTryStatement.class, tryblocks, true); boolean closed = false;