From d4a8cc90482cb538a88f74a9aae99a323e547c84 Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Fri, 2 Mar 2012 09:19:25 -0800 Subject: [PATCH] generics --- .../loadtime/WeavingURLClassLoaderTest.java | 44 +++++++++---------- .../compiler/WeaverMessageHandler.java | 2 +- .../org/aspectj/tools/ajc/AjcTestCase.java | 22 +++++----- .../aspectj/tools/ajc/CompilationResult.java | 40 +++++++++-------- .../weaver/patterns/WildTypePattern.java | 12 ++--- .../testing/harness/bridge/AjcTest.java | 32 +++++++------- .../tools/AjdeInteractionTestbed.java | 6 +-- .../weaver/WeaverMessagesTestCase.java | 7 ++- .../tools/cache/WeavedClassCacheTest.java | 2 - 9 files changed, 83 insertions(+), 84 deletions(-) diff --git a/loadtime/testsrc/org/aspectj/weaver/loadtime/WeavingURLClassLoaderTest.java b/loadtime/testsrc/org/aspectj/weaver/loadtime/WeavingURLClassLoaderTest.java index 0305b9660..aa161cdc5 100644 --- a/loadtime/testsrc/org/aspectj/weaver/loadtime/WeavingURLClassLoaderTest.java +++ b/loadtime/testsrc/org/aspectj/weaver/loadtime/WeavingURLClassLoaderTest.java @@ -59,7 +59,7 @@ public class WeavingURLClassLoaderTest extends TestCase { WeavingURLClassLoader loader = new WeavingURLClassLoader(getClass().getClassLoader()); try { - Class clazz = loader.loadClass("LTWHelloWorld"); + Class clazz = loader.loadClass("LTWHelloWorld"); invokeMain(clazz, new String[] {}); } catch (Exception ex) { fail(ex.toString()); @@ -76,7 +76,7 @@ public class WeavingURLClassLoaderTest extends TestCase { WeavingURLClassLoader loader = new WeavingURLClassLoader(getClass().getClassLoader()); try { - Class clazz = loader.loadClass("LTWHelloWorld"); + Class clazz = loader.loadClass("LTWHelloWorld"); invokeMain(clazz, new String[] { "LTWAspect" }); } catch (Exception ex) { fail(ex.toString()); @@ -122,7 +122,7 @@ public class WeavingURLClassLoaderTest extends TestCase { WeavingURLClassLoader loader = new WeavingURLClassLoader(classURLs, aspectURLs, getClass().getClassLoader()); try { - Class clazz = loader.loadClass("LTWHelloWorld"); + Class clazz = loader.loadClass("LTWHelloWorld"); invokeMain(clazz, new String[] { "LTWAspect" }); } catch (Exception ex) { fail(ex.toString()); @@ -136,7 +136,7 @@ public class WeavingURLClassLoaderTest extends TestCase { WeavingURLClassLoader loader = new WeavingURLClassLoader(getClass().getClassLoader()); try { - Class clazz = loader.loadClass("LTWHelloWorld"); + Class clazz = loader.loadClass("LTWHelloWorld"); invokeMain(clazz, new String[] { "LTWAspect" }); } catch (Exception ex) { fail(ex.toString()); @@ -151,7 +151,7 @@ public class WeavingURLClassLoaderTest extends TestCase { WeavingURLClassLoader loader = new WeavingURLClassLoader(getClass().getClassLoader()); try { - Class clazz = loader.loadClass("LTWHelloWorld"); + Class clazz = loader.loadClass("LTWHelloWorld"); invokeMain(clazz, new String[] { "LTWAspect" }); } catch (Exception ex) { fail(ex.toString()); @@ -166,7 +166,7 @@ public class WeavingURLClassLoaderTest extends TestCase { WeavingURLClassLoader loader = new WeavingURLClassLoader(getClass().getClassLoader()); try { - Class clazz = loader.loadClass("LTWHelloWorld"); + Class clazz = loader.loadClass("LTWHelloWorld"); invokeMain(clazz, new String[] { "LTWAspect" }); } catch (Exception ex) { fail(ex.toString()); @@ -179,7 +179,7 @@ public class WeavingURLClassLoaderTest extends TestCase { WeavingURLClassLoader loader = new WeavingURLClassLoader(getClass().getClassLoader()); try { - Class clazz = loader.loadClass("LTWHelloWorld"); + Class clazz = loader.loadClass("LTWHelloWorld"); invokeMain(clazz, new String[] {}); } catch (Exception ex) { fail(ex.toString()); @@ -192,7 +192,7 @@ public class WeavingURLClassLoaderTest extends TestCase { WeavingURLClassLoader loader = new WeavingURLClassLoader(getClass().getClassLoader()); try { - Class clazz = loader.loadClass("LTWHelloWorld"); + Class clazz = loader.loadClass("LTWHelloWorld"); invokeMain(clazz, new String[] {}); fail("Expecting org.aspectj.bridge.AbortException"); } catch (Exception ex) { @@ -207,7 +207,7 @@ public class WeavingURLClassLoaderTest extends TestCase { WeavingURLClassLoader loader = new WeavingURLClassLoader(getClass().getClassLoader()); try { - Class clazz = loader.loadClass("LTWHelloWorld"); + Class clazz = loader.loadClass("LTWHelloWorld"); invokeMain(clazz, new String[] { "LTWAroundClosure" }); } catch (Exception ex) { fail(ex.toString()); @@ -223,7 +223,7 @@ public class WeavingURLClassLoaderTest extends TestCase { WeavingURLClassLoader loader = new WeavingURLClassLoader(classURLs, aspectURLs, getClass().getClassLoader()); try { - Class clazz = loader.loadClass("LTWHelloWorld"); + Class clazz = loader.loadClass("LTWHelloWorld"); invokeMain(clazz, new String[] { "LTWInterfaceITD", "LTWFieldITD", "LTWMethodITD" }); } catch (Exception ex) { ex.printStackTrace(); @@ -243,7 +243,7 @@ public class WeavingURLClassLoaderTest extends TestCase { WeavingURLClassLoader loader = new WeavingURLClassLoader(classURLs, aspectURLs, getClass().getClassLoader()); try { - Class clazz = loader.loadClass("LTWHelloWorld"); + Class clazz = loader.loadClass("LTWHelloWorld"); invokeMain(clazz, new String[] { "LTWPerthis" }); } catch (Exception ex) { fail(ex.toString()); @@ -262,7 +262,7 @@ public class WeavingURLClassLoaderTest extends TestCase { WeavingURLClassLoader loader = new WeavingURLClassLoader(classURLs, aspectURLs, getClass().getClassLoader()); try { - Class clazz = loader.loadClass("LTWHelloWorld"); + Class clazz = loader.loadClass("LTWHelloWorld"); invokeMain(clazz, new String[] { "LTWAspect", "LTWAroundClosure", "LTWPerthis", "LTWInterfaceITD", "LTWFieldITD", "LTWMethodITD", "LTWPerthis" }); } catch (Exception ex) { @@ -315,7 +315,7 @@ public class WeavingURLClassLoaderTest extends TestCase { loader.addURL(classes); try { - Class clazz = loader.loadClass("LTWHelloWorld"); + Class clazz = loader.loadClass("LTWHelloWorld"); invokeMain(clazz, new String[] { "LTWAspect" }); } catch (Exception ex) { fail(ex.toString()); @@ -336,7 +336,7 @@ public class WeavingURLClassLoaderTest extends TestCase { WeavingURLClassLoader child = new WeavingURLClassLoader(classURLs, aspectURLs, parent); try { - Class clazz = child.loadClass("LTWHelloWorld"); + Class clazz = child.loadClass("LTWHelloWorld"); invokeMain(clazz, new String[] { "LTWAspect" }); } catch (Exception ex) { fail(ex.toString()); @@ -352,7 +352,7 @@ public class WeavingURLClassLoaderTest extends TestCase { WeavingURLClassLoader loader = new WeavingURLClassLoader(getClass().getClassLoader()); try { - Class clazz = loader.loadClass("LTWHelloWorld"); + Class clazz = loader.loadClass("LTWHelloWorld"); invokeMain(clazz, new String[] { "LTWAspect" }); fail("Expecting java.lang.NoClassDefFoundError"); } catch (Exception ex) { @@ -372,7 +372,7 @@ public class WeavingURLClassLoaderTest extends TestCase { WeavingURLClassLoader loader = new WeavingURLClassLoader(getClass().getClassLoader()); try { - Class clazz = loader.loadClass("ltw.LTWPackageTest"); + Class clazz = loader.loadClass("ltw.LTWPackageTest"); invokeMain(clazz, new String[] {}); Package pakkage = clazz.getPackage(); assertTrue("Expected 'ltw' got " + pakkage, (pakkage != null)); @@ -442,7 +442,7 @@ public class WeavingURLClassLoaderTest extends TestCase { URL[] aspectURLs = new URL[] { aspects }; WeavingURLClassLoader loader = new WeavingURLClassLoader(classURLs, aspectURLs, getClass().getClassLoader()); - Class clazz = loader.loadClass("packag.Main"); + Class clazz = loader.loadClass("packag.Main"); invokeMain(clazz, new String[] {}); } @@ -455,7 +455,7 @@ public class WeavingURLClassLoaderTest extends TestCase { URL[] aspectURLs = new URL[] { aspects }; WeavingURLClassLoader loader = new WeavingURLClassLoader(classURLs, aspectURLs, getClass().getClassLoader()); - Class clazz = loader.loadClass("packag.Main"); + Class clazz = loader.loadClass("packag.Main"); invokeMain(clazz, new String[] {}); fail("Should reject bad aspect MissingFile"); } catch (AbortException ae) { @@ -473,7 +473,7 @@ public class WeavingURLClassLoaderTest extends TestCase { URL[] aspectURLs = new URL[] { aspects }; ClassLoader parent = getClass().getClassLoader(); WeavingURLClassLoader loader = new WeavingURLClassLoader(classURLs, aspectURLs, parent); - Class clazz = loader.loadClass("packag.Main"); + Class clazz = loader.loadClass("packag.Main"); invokeMain(clazz, new String[] {}); // throws Error unless advice applies } @@ -484,7 +484,7 @@ public class WeavingURLClassLoaderTest extends TestCase { URL[] classURLs = new URL[] { classes, aspectjrt }; ClassLoader parent = getClass().getClassLoader(); WeavingURLClassLoader loader = new WeavingURLClassLoader(classURLs, new URL[] {}, parent); - Class clazz = loader.loadClass("packag.Main"); + Class clazz = loader.loadClass("packag.Main"); invokeMain(clazz, new String[] {}); // throws Error because advice does not apply } @@ -494,7 +494,7 @@ public class WeavingURLClassLoaderTest extends TestCase { } public static void invokeMain(Class clazz, String[] args) { - Class[] paramTypes = new Class[1]; + Class[] paramTypes = new Class[1]; paramTypes[0] = args.getClass(); try { @@ -535,7 +535,7 @@ public class WeavingURLClassLoaderTest extends TestCase { /* Restore system properties */ Properties systemProperties = System.getProperties(); - for (Enumeration enu = savedProperties.keys(); enu.hasMoreElements();) { + for (Enumeration enu = savedProperties.keys(); enu.hasMoreElements();) { String key = (String) enu.nextElement(); String value = savedProperties.getProperty(key); if (value == NULL) { diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/WeaverMessageHandler.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/WeaverMessageHandler.java index 9d7b5535d..2af3c8fe6 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/WeaverMessageHandler.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/WeaverMessageHandler.java @@ -209,7 +209,7 @@ public class WeaverMessageHandler implements IMessageHandler { private IProblem[] buildSeeAlsoProblems(IProblem originalProblem, List sourceLocations, CompilationResult problemSource, boolean usedBinarySourceFileName) { - List ret = new ArrayList(); + List ret = new ArrayList(); for (int i = 0; i < sourceLocations.size(); i++) { ISourceLocation loc = (ISourceLocation) sourceLocations.get(i); diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java index 7a9066a4a..d5ec93e66 100644 --- a/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java +++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java @@ -430,11 +430,11 @@ public class AjcTestCase extends TestCase { List missingWarnings = copyAll(expected.warnings); List missingErrors = copyAll(expected.errors); List missingWeaves = copyAll(expected.weaves); - List extraFails = copyAll(result.getFailMessages()); - List extraInfos = copyAll(result.getInfoMessages()); - List extraWarnings = copyAll(result.getWarningMessages()); - List extraErrors = copyAll(result.getErrorMessages()); - List extraWeaves = copyAll(result.getWeaveMessages()); + List extraFails = copyAll(result.getFailMessages()); + List extraInfos = copyAll(result.getInfoMessages()); + List extraWarnings = copyAll(result.getWarningMessages()); + List extraErrors = copyAll(result.getErrorMessages()); + List extraWeaves = copyAll(result.getWeaveMessages()); compare(expected.fails, result.getFailMessages(), missingFails, extraFails); compare(expected.warnings, result.getWarningMessages(), missingWarnings, extraWarnings); compare(expected.errors, result.getErrorMessages(), missingErrors, extraErrors); @@ -477,8 +477,8 @@ public class AjcTestCase extends TestCase { /** * Helper method to build a new message list for passing to a MessageSpec. */ - protected List newMessageList(Message m1) { - List ret = new ArrayList(); + protected List newMessageList(Message m1) { + List ret = new ArrayList(); ret.add(m1); return ret; } @@ -486,8 +486,8 @@ public class AjcTestCase extends TestCase { /** * Helper method to build a new message list for passing to a MessageSpec. */ - protected List newMessageList(Message m1, Message m2) { - List ret = new ArrayList(); + protected List newMessageList(Message m1, Message m2) { + List ret = new ArrayList(); ret.add(m1); ret.add(m2); return ret; @@ -496,8 +496,8 @@ public class AjcTestCase extends TestCase { /** * Helper method to build a new message list for passing to a MessageSpec. */ - protected List newMessageList(Message m1, Message m2, Message m3) { - List ret = new ArrayList(); + protected List newMessageList(Message m1, Message m2, Message m3) { + List ret = new ArrayList(); ret.add(m1); ret.add(m2); ret.add(m3); diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/CompilationResult.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/CompilationResult.java index a6f589265..01e331523 100644 --- a/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/CompilationResult.java +++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/CompilationResult.java @@ -15,6 +15,8 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; +import org.aspectj.bridge.IMessage; + /** * Utility class that makes the results of a compiler run available. *

@@ -35,11 +37,11 @@ public class CompilationResult { private String[] args; private String stdOut; private String stdErr; - private List /*IMessage*/ infoMessages; - private List /*IMessage*/ errorMessages; - private List /*IMessage*/ warningMessages; - private List /*IMessage*/ failMessages; - private List /*IMessage*/ weaveMessages; + private List infoMessages; + private List errorMessages; + private List warningMessages; + private List failMessages; + private List weaveMessages; /** * Build a compilation result - called by the Ajc.compile and @@ -50,19 +52,19 @@ public class CompilationResult { String[] args, String stdOut, String stdErr, - List infoMessages, - List errorMessages, - List warningMessages, - List failMessages, - List weaveMessages) { + List infoMessages, + List errorMessages, + List warningMessages, + List failMessages, + List weaveMessages) { this.args = args; this.stdOut = stdOut; this.stdErr = stdErr; - this.infoMessages = (infoMessages == null) ? Collections.EMPTY_LIST : infoMessages; - this.errorMessages = (errorMessages == null) ? Collections.EMPTY_LIST : errorMessages; - this.warningMessages = (warningMessages == null) ? Collections.EMPTY_LIST : warningMessages; - this.failMessages = (failMessages == null) ? Collections.EMPTY_LIST : failMessages; - this.weaveMessages = (weaveMessages == null) ? Collections.EMPTY_LIST : weaveMessages; + this.infoMessages = (infoMessages == null) ? Collections.emptyList() : infoMessages; + this.errorMessages = (errorMessages == null) ? Collections.emptyList() : errorMessages; + this.warningMessages = (warningMessages == null) ? Collections.emptyList() : warningMessages; + this.failMessages = (failMessages == null) ? Collections.emptyList() : failMessages; + this.weaveMessages = (weaveMessages == null) ? Collections.emptyList() : weaveMessages; } /** @@ -122,7 +124,7 @@ public class CompilationResult { * though. * @see org.aspectj.tools.ajc.AjcTestCase */ - public List /*IMessage*/ getErrorMessages() { return errorMessages; } + public List getErrorMessages() { return errorMessages; } /** * The warning messages produced by the compiler. The list * entries are the IMessage objects created during the @@ -132,7 +134,7 @@ public class CompilationResult { * though. * @see org.aspectj.tools.ajc.AjcTestCase */ - public List /*IMessage*/ getWarningMessages() { return warningMessages; } + public List getWarningMessages() { return warningMessages; } /** * The fail or abort messages produced by the compiler. The list * entries are the IMessage objects created during the @@ -142,9 +144,9 @@ public class CompilationResult { * though. * @see org.aspectj.tools.ajc.AjcTestCase */ - public List /*IMessage*/ getFailMessages() { return failMessages; } + public List getFailMessages() { return failMessages; } - public List /*IMessage*/ getWeaveMessages() { return weaveMessages; } + public List getWeaveMessages() { return weaveMessages; } /** * Returns string containing message count summary, list of messages diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/patterns/WildTypePattern.java b/org.aspectj.matcher/src/org/aspectj/weaver/patterns/WildTypePattern.java index efe5bb997..9081c5c02 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/patterns/WildTypePattern.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/patterns/WildTypePattern.java @@ -109,23 +109,23 @@ public class WildTypePattern extends TypePattern { setLocation(namePatterns[0].getSourceContext(), namePatterns[0].getStart(), namePatterns[namePatterns.length - 1].getEnd()); } - public WildTypePattern(List names, boolean includeSubtypes, int dim) { + public WildTypePattern(List names, boolean includeSubtypes, int dim) { this((NamePattern[]) names.toArray(new NamePattern[names.size()]), includeSubtypes, dim, false, TypePatternList.EMPTY); } - public WildTypePattern(List names, boolean includeSubtypes, int dim, int endPos) { + public WildTypePattern(List names, boolean includeSubtypes, int dim, int endPos) { this(names, includeSubtypes, dim); this.end = endPos; } - public WildTypePattern(List names, boolean includeSubtypes, int dim, int endPos, boolean isVarArg) { + public WildTypePattern(List names, boolean includeSubtypes, int dim, int endPos, boolean isVarArg) { this(names, includeSubtypes, dim); this.end = endPos; this.isVarArgs = isVarArg; } - public WildTypePattern(List names, boolean includeSubtypes, int dim, int endPos, boolean isVarArg, TypePatternList typeParams, + public WildTypePattern(List names, boolean includeSubtypes, int dim, int endPos, boolean isVarArg, TypePatternList typeParams, TypePattern upperBound, TypePattern[] additionalInterfaceBounds, TypePattern lowerBound) { this((NamePattern[]) names.toArray(new NamePattern[names.size()]), includeSubtypes, dim, isVarArg, typeParams); this.end = endPos; @@ -134,7 +134,7 @@ public class WildTypePattern extends TypePattern { this.additionalInterfaceBounds = additionalInterfaceBounds; } - public WildTypePattern(List names, boolean includeSubtypes, int dim, int endPos, boolean isVarArg, TypePatternList typeParams) { + public WildTypePattern(List names, boolean includeSubtypes, int dim, int endPos, boolean isVarArg, TypePatternList typeParams) { this((NamePattern[]) names.toArray(new NamePattern[names.size()]), includeSubtypes, dim, isVarArg, typeParams); this.end = endPos; } @@ -588,7 +588,7 @@ public class WildTypePattern extends TypePattern { } @Override - public TypePattern parameterizeWith(Map typeVariableMap, World w) { + public TypePattern parameterizeWith(Map typeVariableMap, World w) { NamePattern[] newNamePatterns = new NamePattern[namePatterns.length]; for (int i = 0; i < namePatterns.length; i++) { newNamePatterns[i] = namePatterns[i]; diff --git a/testing/src/org/aspectj/testing/harness/bridge/AjcTest.java b/testing/src/org/aspectj/testing/harness/bridge/AjcTest.java index 8db9acd1f..bdebae02c 100644 --- a/testing/src/org/aspectj/testing/harness/bridge/AjcTest.java +++ b/testing/src/org/aspectj/testing/harness/bridge/AjcTest.java @@ -107,22 +107,22 @@ public class AjcTest extends RunSpecIterator { private static final String REQUIRE_KEYWORDS = "RequireKeywords="; private static final String SKIP_KEYWORDS = "SkipKeywords="; private static final String PICK_PR = "PR="; - private static final List VALID_SUFFIXES + private static final List VALID_SUFFIXES = Collections.unmodifiableList(Arrays.asList(new String[] { TITLE_LIST, TITLE_FAIL_LIST, TITLE_CONTAINS, REQUIRE_KEYWORDS, SKIP_KEYWORDS, PICK_PR })); /** Map String titlesName to List (String) of titles to accept */ - private static final Map TITLES = new HashMap(); + private static final Map> TITLES = new HashMap>(); - private static List getTitles(String titlesName) { + private static List getTitles(String titlesName) { return getTitles(titlesName, false); } - private static List getTitles(String titlesName, boolean fail) { + private static List getTitles(String titlesName, boolean fail) { if (LangUtil.isEmpty(titlesName)) { - return Collections.EMPTY_LIST; + return Collections.emptyList(); } - List result = (List) TITLES.get(titlesName); + List result = (List) TITLES.get(titlesName); if (null == result) { result = makeTitlesList(titlesName, fail); TITLES.put(titlesName, result); @@ -140,7 +140,7 @@ public class AjcTest extends RunSpecIterator { * @param fail if true, only read titles prefixed "FAIL" from files * @return the unmodifiable List of titles (maybe empty, never null) */ - private static List makeTitlesList(String titlesKey, boolean fail) { + private static List makeTitlesList(String titlesKey, boolean fail) { File file = new File(titlesKey); return file.canRead() ? readTitlesFile(file, fail) @@ -154,8 +154,8 @@ public class AjcTest extends RunSpecIterator { * @param titlesList a comma-delimited String of titles * @return the unmodifiable List of titles (maybe empty, never null) */ - private static List parseTitlesList(String titlesList) { - ArrayList result = new ArrayList(); + private static List parseTitlesList(String titlesList) { + ArrayList result = new ArrayList(); String last = null; StringTokenizer st = new StringTokenizer(titlesList, ","); while (st.hasMoreTokens()) { @@ -199,8 +199,8 @@ public class AjcTest extends RunSpecIterator { * @param fail if true, only select titles prefixed "FAIL" * @return the unmodifiable List of titles (maybe empty, never null) */ - private static List readTitlesFile(File titlesFile, boolean fail) { - ArrayList result = new ArrayList(); + private static List readTitlesFile(File titlesFile, boolean fail) { + ArrayList result = new ArrayList(); Reader reader = null; try { reader = new FileReader(titlesFile); @@ -376,8 +376,8 @@ public class AjcTest extends RunSpecIterator { } option = option.substring(OPTION_PREFIX.length()); boolean keywordMustExist = false; - List permittedTitles = null; - List permittedTitleStrings = null; + List permittedTitles = null; + List permittedTitleStrings = null; String havePr = null; if (option.startsWith(REQUIRE_KEYWORDS)) { option = option.substring(REQUIRE_KEYWORDS.length()); @@ -407,7 +407,7 @@ public class AjcTest extends RunSpecIterator { } if (null != permittedTitleStrings) { boolean gotHit = false; - for (Iterator iter = permittedTitleStrings.iterator(); + for (Iterator iter = permittedTitleStrings.iterator(); !gotHit && iter.hasNext(); ) { String substring = (String) iter.next(); @@ -434,9 +434,9 @@ public class AjcTest extends RunSpecIterator { } } else { // all other options handled as comma-delimited lists - List specs = LangUtil.commaSplit(option); + List specs = LangUtil.commaSplit(option); // XXX also throw Error on empty specs... - for (Iterator iter = specs.iterator(); iter.hasNext();) { + for (Iterator iter = specs.iterator(); iter.hasNext();) { String spec = (String) iter.next(); if (null != havePr) { if (havePr.equals(spec)) { // String.equals() diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java b/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java index 80d7a8d4d..ae1448c9b 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java @@ -77,7 +77,7 @@ public class AjdeInteractionTestbed extends TestCase { } public void addXmlConfigFile(String projectName, String xmlfile) { - List l = new ArrayList(); + List l = new ArrayList(); l.add(xmlfile); AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName); ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration()).setProjectXmlConfigFiles(l); @@ -106,7 +106,7 @@ public class AjdeInteractionTestbed extends TestCase { public void configureAspectPath(String projectName, File aspectpath) { AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName); - Set s = new HashSet(); + Set s = new HashSet(); s.add(aspectpath); ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration()).setAspectPath(s); } @@ -121,7 +121,7 @@ public class AjdeInteractionTestbed extends TestCase { ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration()).setJavaOptions(options); } - public static void configureInPath(String projectName, Set inpath) { + public static void configureInPath(String projectName, Set inpath) { AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName); ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration()).setInpath(inpath); } diff --git a/weaver/testsrc/org/aspectj/weaver/WeaverMessagesTestCase.java b/weaver/testsrc/org/aspectj/weaver/WeaverMessagesTestCase.java index ea5dd9d67..7326971d3 100644 --- a/weaver/testsrc/org/aspectj/weaver/WeaverMessagesTestCase.java +++ b/weaver/testsrc/org/aspectj/weaver/WeaverMessagesTestCase.java @@ -18,16 +18,15 @@ import java.util.MissingResourceException; import junit.framework.TestCase; /** - * @author colyer - * + * @author Adrian Colyer */ public class WeaverMessagesTestCase extends TestCase { public void testAllMessagesDefined() { - Class wmClass = WeaverMessages.class; + Class wmClass = WeaverMessages.class; Field[] fields = wmClass.getDeclaredFields(); - List fieldList = new ArrayList(); + List fieldList = new ArrayList(); for (int i = 0; i < fields.length; i++) { Field f = fields[i]; if (f.getType() == String.class) { diff --git a/weaver/testsrc/org/aspectj/weaver/tools/cache/WeavedClassCacheTest.java b/weaver/testsrc/org/aspectj/weaver/tools/cache/WeavedClassCacheTest.java index 84406b558..6c3d75a29 100644 --- a/weaver/testsrc/org/aspectj/weaver/tools/cache/WeavedClassCacheTest.java +++ b/weaver/testsrc/org/aspectj/weaver/tools/cache/WeavedClassCacheTest.java @@ -18,8 +18,6 @@ import org.aspectj.bridge.IMessage; import org.aspectj.bridge.IMessageHandler; import org.aspectj.weaver.tools.GeneratedClassHandler; -import java.net.URL; -import java.net.URLClassLoader; import java.util.HashMap; import java.util.LinkedList; import java.util.List; -- 2.39.5