You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by jh...@apache.org on 2014/07/04 15:15:06 UTC

[2/8] make it compile under Java5 (1.5.0_22-b03)

http://git-wip-us.apache.org/repos/asf/ant/blob/13f6d98c/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
index 2b41f8e..a0ce632 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
@@ -134,9 +134,9 @@ public class JUnitTask extends Task {
         = System.getProperty("line.separator");
     private static final String CLASSPATH = "CLASSPATH";
     private CommandlineJava commandline;
-    private Vector<JUnitTest> tests = new Vector<JUnitTest>();
-    private Vector<BatchTest> batchTests = new Vector<BatchTest>();
-    private Vector<FormatterElement> formatters = new Vector<FormatterElement>();
+    private final Vector<JUnitTest> tests = new Vector<JUnitTest>();
+    private final Vector<BatchTest> batchTests = new Vector<BatchTest>();
+    private final Vector<FormatterElement> formatters = new Vector<FormatterElement>();
     private File dir = null;
 
     private Integer timeout = null;
@@ -146,7 +146,7 @@ public class JUnitTask extends Task {
     private JUnitTaskMirror.JUnitTestRunnerMirror runner = null;
 
     private boolean newEnvironment = false;
-    private Environment env = new Environment();
+    private final Environment env = new Environment();
 
     private boolean includeAntRuntime = true;
     private Path antRuntimeClasses = null;
@@ -204,7 +204,7 @@ public class JUnitTask extends Task {
      *
      * @param value force class reloading for each test case
      */
-    public void setReloading(boolean value) {
+    public void setReloading(final boolean value) {
         reloading = value;
     }
 
@@ -220,7 +220,7 @@ public class JUnitTask extends Task {
      *
      * @since Ant 1.5
      */
-    public void setFiltertrace(boolean value) {
+    public void setFiltertrace(final boolean value) {
         this.filterTrace = value;
     }
 
@@ -234,7 +234,7 @@ public class JUnitTask extends Task {
      *
      * @since Ant 1.2
      */
-    public void setHaltonerror(boolean value) {
+    public void setHaltonerror(final boolean value) {
         this.haltOnError = value;
     }
 
@@ -249,7 +249,7 @@ public class JUnitTask extends Task {
      *
      * @since Ant 1.4
      */
-    public void setErrorProperty(String propertyName) {
+    public void setErrorProperty(final String propertyName) {
         this.errorProperty = propertyName;
     }
 
@@ -264,7 +264,7 @@ public class JUnitTask extends Task {
      *
      * @since Ant 1.2
      */
-    public void setHaltonfailure(boolean value) {
+    public void setHaltonfailure(final boolean value) {
         this.haltOnFail = value;
     }
 
@@ -279,7 +279,7 @@ public class JUnitTask extends Task {
      *
      * @since Ant 1.4
      */
-    public void setFailureProperty(String propertyName) {
+    public void setFailureProperty(final String propertyName) {
         this.failureProperty = propertyName;
     }
 
@@ -296,7 +296,7 @@ public class JUnitTask extends Task {
      *
      * @since Ant 1.2
      */
-    public void setFork(boolean value) {
+    public void setFork(final boolean value) {
         this.fork = value;
     }
 
@@ -319,7 +319,7 @@ public class JUnitTask extends Task {
      * @param mode the mode to use.
      * @since Ant 1.6.2
      */
-    public void setForkMode(ForkMode mode) {
+    public void setForkMode(final ForkMode mode) {
         this.forkMode = mode;
     }
 
@@ -333,7 +333,7 @@ public class JUnitTask extends Task {
      *
      * @since Ant 1.9.4
      */
-    public void setThreads(int threads) {
+    public void setThreads(final int threads) {
         if (threads >= 0) {
             this.threads = threads;
         }
@@ -351,7 +351,7 @@ public class JUnitTask extends Task {
      *
      * @since Ant 1.2
      */
-    public void setPrintsummary(SummaryAttribute value) {
+    public void setPrintsummary(final SummaryAttribute value) {
         summaryValue = value.getValue();
         summary = value.asBoolean();
     }
@@ -375,7 +375,7 @@ public class JUnitTask extends Task {
          * @return boolean equivalent of the value
          */
         public boolean asBoolean() {
-            String v = getValue();
+            final String v = getValue();
             return "true".equals(v)
                 || "on".equals(v)
                 || "yes".equals(v)
@@ -394,7 +394,7 @@ public class JUnitTask extends Task {
      *
      * @since Ant 1.2
      */
-    public void setTimeout(Integer value) {
+    public void setTimeout(final Integer value) {
         timeout = value;
     }
 
@@ -405,7 +405,7 @@ public class JUnitTask extends Task {
      *
      * @since Ant 1.2
      */
-    public void setMaxmemory(String max) {
+    public void setMaxmemory(final String max) {
         getCommandline().setMaxmemory(max);
     }
 
@@ -419,7 +419,7 @@ public class JUnitTask extends Task {
      *
      * @since Ant 1.2
      */
-    public void setJvm(String value) {
+    public void setJvm(final String value) {
         getCommandline().setVm(value);
     }
 
@@ -443,7 +443,7 @@ public class JUnitTask extends Task {
      *
      * @since Ant 1.2
      */
-    public void setDir(File dir) {
+    public void setDir(final File dir) {
         this.dir = dir;
     }
 
@@ -457,7 +457,7 @@ public class JUnitTask extends Task {
      * @param sysp environment variable to add
      */
     @Deprecated
-	public void addSysproperty(Environment.Variable sysp) {
+	public void addSysproperty(final Environment.Variable sysp) {
 
         getCommandline().addSysproperty(sysp);
     }
@@ -469,10 +469,10 @@ public class JUnitTask extends Task {
      * @param sysp new environment variable to add
      * @since Ant 1.6
      */
-    public void addConfiguredSysproperty(Environment.Variable sysp) {
+    public void addConfiguredSysproperty(final Environment.Variable sysp) {
         // get a build exception if there is a missing key or value
         // see bugzilla report 21684
-        String testString = sysp.getContent();
+        final String testString = sysp.getContent();
         getProject().log("sysproperty added : " + testString, Project.MSG_DEBUG);
         getCommandline().addSysproperty(sysp);
     }
@@ -487,7 +487,7 @@ public class JUnitTask extends Task {
      * @param sysp set of properties to be added
      * @since Ant 1.6
      */
-    public void addSyspropertyset(PropertySet sysp) {
+    public void addSyspropertyset(final PropertySet sysp) {
         getCommandline().addSyspropertyset(sysp);
     }
 
@@ -517,7 +517,7 @@ public class JUnitTask extends Task {
      * @param var environment variable to be added
      * @since Ant 1.5
      */
-    public void addEnv(Environment.Variable var) {
+    public void addEnv(final Environment.Variable var) {
         env.addVariable(var);
     }
 
@@ -529,7 +529,7 @@ public class JUnitTask extends Task {
      * @param newenv boolean indicating if setting a new environment is wished
      * @since Ant 1.5
      */
-    public void setNewenvironment(boolean newenv) {
+    public void setNewenvironment(final boolean newenv) {
         newEnvironment = newenv;
     }
 
@@ -541,7 +541,7 @@ public class JUnitTask extends Task {
      * be be defaults for the tests, but allows
      * individual tests to override the defaults.
      */
-    private void preConfigure(BaseTest test) {
+    private void preConfigure(final BaseTest test) {
         test.setFiltertrace(filterTrace);
         test.setHaltonerror(haltOnError);
         if (errorProperty != null) {
@@ -561,7 +561,7 @@ public class JUnitTask extends Task {
      *
      * @since Ant 1.2
      */
-    public void addTest(JUnitTest test) {
+    public void addTest(final JUnitTest test) {
         tests.addElement(test);
         preConfigure(test);
     }
@@ -575,7 +575,7 @@ public class JUnitTask extends Task {
      * @since Ant 1.2
      */
     public BatchTest createBatchTest() {
-        BatchTest test = new BatchTest(getProject());
+        final BatchTest test = new BatchTest(getProject());
         batchTests.addElement(test);
         preConfigure(test);
         return test;
@@ -587,7 +587,7 @@ public class JUnitTask extends Task {
      * @param fe formatter element
      * @since Ant 1.2
      */
-    public void addFormatter(FormatterElement fe) {
+    public void addFormatter(final FormatterElement fe) {
         formatters.addElement(fe);
     }
 
@@ -597,7 +597,7 @@ public class JUnitTask extends Task {
      * @param b include ant run time yes or no
      * @since Ant 1.5
      */
-    public void setIncludeantruntime(boolean b) {
+    public void setIncludeantruntime(final boolean b) {
         includeAntRuntime = b;
     }
 
@@ -614,7 +614,7 @@ public class JUnitTask extends Task {
      * @param showOutput if true, send output to Ant's logging system too
      * @since Ant 1.5
      */
-    public void setShowOutput(boolean showOutput) {
+    public void setShowOutput(final boolean showOutput) {
         this.showOutput = showOutput;
     }
 
@@ -625,7 +625,7 @@ public class JUnitTask extends Task {
      *                           is true).
      * @since Ant 1.7.0
      */
-    public void setOutputToFormatters(boolean outputToFormatters) {
+    public void setOutputToFormatters(final boolean outputToFormatters) {
         this.outputToFormatters = outputToFormatters;
     }
 
@@ -635,7 +635,7 @@ public class JUnitTask extends Task {
      *
      * @since Ant 1.8.0
      */
-    public void setLogFailedTests(boolean logFailedTests) {
+    public void setLogFailedTests(final boolean logFailedTests) {
         this.logFailedTests = logFailedTests;
     }
 
@@ -644,7 +644,7 @@ public class JUnitTask extends Task {
      * @since Ant 1.6
      * @param asserts assertion set
      */
-    public void addAssertions(Assertions asserts) {
+    public void addAssertions(final Assertions asserts) {
         if (getCommandline().getAssertions() != null) {
             throw new BuildException("Only one assertion declaration is allowed");
         }
@@ -672,7 +672,7 @@ public class JUnitTask extends Task {
      * @param cloneVm a <code>boolean</code> value.
      * @since Ant 1.7
      */
-    public void setCloneVm(boolean cloneVm) {
+    public void setCloneVm(final boolean cloneVm) {
         getCommandline().setCloneVm(cloneVm);
     }
 
@@ -691,7 +691,7 @@ public class JUnitTask extends Task {
      * @param tmpDir location where temporary files should go to
      * @since Ant 1.6
      */
-    public void setTempdir(File tmpDir) {
+    public void setTempdir(final File tmpDir) {
         if (tmpDir != null) {
             if (!tmpDir.exists() || !tmpDir.isDirectory()) {
                 throw new BuildException(tmpDir.toString()
@@ -711,7 +711,7 @@ public class JUnitTask extends Task {
      *
      * @since Ant 1.8.2
      */
-    public void setEnableTestListenerEvents(boolean b) {
+    public void setEnableTestListenerEvents(final boolean b) {
         enableTestListenerEvents = b;
     }
 
@@ -720,7 +720,7 @@ public class JUnitTask extends Task {
      * @since Ant 1.8.2
      */
     public boolean getEnableTestListenerEvents() {
-        String e = getProject().getProperty(ENABLE_TESTLISTENER_EVENTS);
+        final String e = getProject().getProperty(ENABLE_TESTLISTENER_EVENTS);
         if (e != null) {
             return Project.toBoolean(e);
         }
@@ -744,23 +744,23 @@ public class JUnitTask extends Task {
         addClasspathEntry("/org/apache/tools/ant/taskdefs/optional/junit/JUnit4TestMethodAdapter.class");
     }
 
-    private static JUnitTaskMirror createMirror(JUnitTask task, ClassLoader loader) {
+    private static JUnitTaskMirror createMirror(final JUnitTask task, final ClassLoader loader) {
         try {
             loader.loadClass("junit.framework.Test"); // sanity check
-        } catch (ClassNotFoundException e) {
+        } catch (final ClassNotFoundException e) {
             throw new BuildException(
                     "The <classpath> for <junit> must include junit.jar "
                     + "if not in Ant's own classpath",
                     e, task.getLocation());
         }
         try {
-            Class c = loader.loadClass(JUnitTaskMirror.class.getName() + "Impl");
+            final Class c = loader.loadClass(JUnitTaskMirror.class.getName() + "Impl");
             if (c.getClassLoader() != loader) {
                 throw new BuildException("Overdelegating loader", task.getLocation());
             }
-            Constructor cons = c.getConstructor(new Class[] {JUnitTask.class});
+            final Constructor cons = c.getConstructor(new Class[] {JUnitTask.class});
             return (JUnitTaskMirror) cons.newInstance(new Object[] {task});
-        } catch (Exception e) {
+        } catch (final Exception e) {
             throw new BuildException(e, task.getLocation());
         }
     }
@@ -777,12 +777,11 @@ public class JUnitTask extends Task {
         if (splitJUnit) {
             final Path path = new Path(getProject());
             path.add(antRuntimeClasses);
-            Path extra = getCommandline().getClasspath();
+            final Path extra = getCommandline().getClasspath();
             if (extra != null) {
                 path.add(extra);
             }
             mirrorLoader = (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() {
-                @Override
 				public Object run() {
                     return new SplitClassLoader(myLoader, path, getProject(),
                                      new String[] {
@@ -822,20 +821,20 @@ public class JUnitTask extends Task {
 
         setupJUnitDelegate();
 
-        List<List> testLists = new ArrayList<List>();
+        final List<List> testLists = new ArrayList<List>();
         /* parallel test execution is only supported for multi-process execution */
-        int threads = ((!fork) || (forkMode.getValue().equals(ForkMode.ONCE))
+        final int threads = ((!fork) || (forkMode.getValue().equals(ForkMode.ONCE))
                        ? 1
                        : this.threads);
 
-        boolean forkPerTest = forkMode.getValue().equals(ForkMode.PER_TEST);
+        final boolean forkPerTest = forkMode.getValue().equals(ForkMode.PER_TEST);
         if (forkPerTest || forkMode.getValue().equals(ForkMode.ONCE)) {
             testLists.addAll(executeOrQueue(getIndividualTests(),
                                             forkPerTest));
         } else { /* forkMode.getValue().equals(ForkMode.PER_BATCH) */
             final int count = batchTests.size();
             for (int i = 0; i < count; i++) {
-                BatchTest batchtest = batchTests.elementAt(i);
+                final BatchTest batchtest = batchTests.elementAt(i);
                 testLists.addAll(executeOrQueue(batchtest.elements(), false));
             }
             testLists.addAll(executeOrQueue(tests.elements(), forkPerTest));
@@ -865,25 +864,24 @@ public class JUnitTask extends Task {
      */
     private class JunitTestThread implements Runnable {
 
-        JunitTestThread(JUnitTask master, Iterator<List> iterator, int id) {
+        JunitTestThread(final JUnitTask master, final Iterator<List> iterator, final int id) {
             this.masterTask = master;
             this.iterator = iterator;
             this.id = id;
         }
 
-        @Override
 		public void run() {
             try {
                 masterTask.oneJunitThread(iterator, id);
-            } catch (BuildException b) {
+            } catch (final BuildException b) {
                 /* saved to rethrow in main thread to be like single-threaded case */
                 caughtBuildException = b;
             }
         }
 
-        private JUnitTask masterTask;
-        private Iterator<List> iterator;
-        private int id;
+        private final JUnitTask masterTask;
+        private final Iterator<List> iterator;
+        private final int id;
     }
 
     /*
@@ -893,7 +891,7 @@ public class JUnitTask extends Task {
      * threads get the same test, or two threads simultaneously pop the list so that a test
      * gets skipped!
      */
-    private List getNextTest(Iterator<List> iter) {
+    private List getNextTest(final Iterator<List> iter) {
         synchronized(iter) {
             if (iter.hasNext()) {
                 return iter.next();
@@ -913,7 +911,7 @@ public class JUnitTask extends Task {
      * fatal reason, no new tests/batches will be started but the running threads will be
      * permitted to complete.  Additional tests may start in already-running batch-test threads.
      */
-    private void oneJunitThread(Iterator<List> iter, int threadId) {
+    private void oneJunitThread(final Iterator<List> iter, final int threadId) {
 
         List l;
         log("Starting test thread " + threadId, Project.MSG_VERBOSE);
@@ -929,7 +927,7 @@ public class JUnitTask extends Task {
     }
 
 
-    private void runTestsInThreads(List<List> testList, int numThreads) {
+    private void runTestsInThreads(final List<List> testList, final int numThreads) {
 
         Iterator<List> iter = testList.iterator();
 
@@ -937,7 +935,7 @@ public class JUnitTask extends Task {
             /* with just one thread just run the test - don't create any threads */
             oneJunitThread(iter, 0);
         } else {
-            Thread[] threads = new Thread[numThreads];
+            final Thread[] threads = new Thread[numThreads];
             int i;
             boolean exceptionOccurred;
 
@@ -946,15 +944,15 @@ public class JUnitTask extends Task {
             /* I assume we don't want to do this with "per batch" forking. */
             List<List> newlist = new ArrayList<List>();
             if (forkMode.getValue().equals(ForkMode.PER_TEST)) {
-                Iterator<List> i1 = testList.iterator();
+                final Iterator<List> i1 = testList.iterator();
                 while (i1.hasNext()) {
-                    List l = i1.next();
+                    final List l = i1.next();
                     if (l.size() == 1) {
                          newlist.add(l);
                     } else {
-                         Iterator i2 = l.iterator();
+                         final Iterator i2 = l.iterator();
                          while (i2.hasNext()) {
-                             List tmpSingleton = new ArrayList();
+                             final List tmpSingleton = new ArrayList();
                              tmpSingleton.add(i2.next());
                              newlist.add(tmpSingleton);
                          }
@@ -979,7 +977,7 @@ public class JUnitTask extends Task {
                     for (i = 0; i < numThreads; i++) {
                          threads[i].join();
                     }
-                } catch (InterruptedException e) {
+                } catch (final InterruptedException e) {
                     exceptionOccurred = true;
                 }
             } while (exceptionOccurred);
@@ -1001,10 +999,10 @@ public class JUnitTask extends Task {
      * @param thread Identifies which thread is test running in (0 for single-threaded runs)
      * @throws BuildException in case of test failures or errors
      */
-    protected void execute(JUnitTest arg, int thread) throws BuildException {
+    protected void execute(final JUnitTest arg, final int thread) throws BuildException {
         validateTestName(arg.getName());
 
-        JUnitTest test = (JUnitTest) arg.clone();
+        final JUnitTest test = (JUnitTest) arg.clone();
         test.setThread(thread);
 
         // set the default values if not specified
@@ -1022,7 +1020,7 @@ public class JUnitTask extends Task {
         if (!test.getFork()) {
             result = executeInVM(test);
         } else {
-            ExecuteWatchdog watchdog = createWatchdog();
+            final ExecuteWatchdog watchdog = createWatchdog();
             result = executeAsForked(test, watchdog, null);
             // null watchdog means no timeout, you'd better not check with null
         }
@@ -1034,7 +1032,7 @@ public class JUnitTask extends Task {
      * @param arg one JUnitTest
      * @throws BuildException in case of test failures or errors
      */
-    protected void execute(JUnitTest arg) throws BuildException {
+    protected void execute(final JUnitTest arg) throws BuildException {
         execute(arg, 0);
     }
 
@@ -1045,7 +1043,7 @@ public class JUnitTask extends Task {
      * @param testName the test name to be validated
      * @throws BuildException if <code>testName</code> is not a valid test name
      */
-    private void validateTestName(String testName) throws BuildException {
+    private void validateTestName(final String testName) throws BuildException {
         if (testName == null || testName.length() == 0
             || testName.equals("null")) {
             throw new BuildException("test name must be specified");
@@ -1058,21 +1056,21 @@ public class JUnitTask extends Task {
      * @param thread Identifies which thread is test running in (0 for single-threaded runs)
      * @throws BuildException on error.
      */
-    protected void execute(List testList, int thread) throws BuildException {
+    protected void execute(final List testList, final int thread) throws BuildException {
         JUnitTest test = null;
         // Create a temporary file to pass the test cases to run to
         // the runner (one test case per line)
-        File casesFile = createTempPropertiesFile("junittestcases");
+        final File casesFile = createTempPropertiesFile("junittestcases");
         BufferedWriter writer = null;
         try {
             writer = new BufferedWriter(new FileWriter(casesFile));
 
             log("Creating casesfile '" + casesFile.getAbsolutePath()
                 + "' with content: ", Project.MSG_VERBOSE);
-            PrintStream logWriter =
+            final PrintStream logWriter =
                 new PrintStream(new LogOutputStream(this, Project.MSG_VERBOSE));
 
-            Iterator iter = testList.iterator();
+            final Iterator iter = testList.iterator();
             while (iter.hasNext()) {
                 test = (JUnitTest) iter.next();
                 test.setThread(thread);
@@ -1099,11 +1097,11 @@ public class JUnitTask extends Task {
             writer = null;
 
             // execute the test and get the return code
-            ExecuteWatchdog watchdog = createWatchdog();
-            TestResultHolder result =
+            final ExecuteWatchdog watchdog = createWatchdog();
+            final TestResultHolder result =
                 executeAsForked(test, watchdog, casesFile);
             actOnTestResult(result, test, "Tests");
-        } catch (IOException e) {
+        } catch (final IOException e) {
             log(e.toString(), Project.MSG_ERR);
             throw new BuildException(e);
         } finally {
@@ -1111,7 +1109,7 @@ public class JUnitTask extends Task {
 
             try {
                 FILE_UTILS.tryHardToDelete(casesFile);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 log(e.toString(), Project.MSG_ERR);
             }
         }
@@ -1122,7 +1120,7 @@ public class JUnitTask extends Task {
      * @param testList the list of tests to execute.
      * @throws BuildException on error.
      */
-    protected void execute(List testList) throws BuildException {
+    protected void execute(final List testList) throws BuildException {
         execute(testList, 0);
     }
 
@@ -1142,8 +1140,8 @@ public class JUnitTask extends Task {
      * or if the junit process can not be forked
      */
     private TestResultHolder executeAsForked(JUnitTest test,
-                                             ExecuteWatchdog watchdog,
-                                             File casesFile)
+                                             final ExecuteWatchdog watchdog,
+                                             final File casesFile)
         throws BuildException {
 
         if (perm != null) {
@@ -1154,7 +1152,7 @@ public class JUnitTask extends Task {
         CommandlineJava cmd;
         try {
             cmd = (CommandlineJava) (getCommandline().clone());
-        } catch (CloneNotSupportedException e) {
+        } catch (final CloneNotSupportedException e) {
             throw new BuildException("This shouldn't happen", e, getLocation());
         }
         if (casesFile == null) {
@@ -1192,11 +1190,11 @@ public class JUnitTask extends Task {
         StringBuffer formatterArg = new StringBuffer(STRING_BUFFER_SIZE);
         final FormatterElement[] feArray = mergeFormatters(test);
         for (int i = 0; i < feArray.length; i++) {
-            FormatterElement fe = feArray[i];
+            final FormatterElement fe = feArray[i];
             if (fe.shouldUse(this)) {
                 formatterArg.append(Constants.FORMATTER);
                 formatterArg.append(fe.getClassname());
-                File outFile = getOutput(fe, test);
+                final File outFile = getOutput(fe, test);
                 if (outFile != null) {
                     formatterArg.append(",");
                     formatterArg.append(outFile);
@@ -1206,29 +1204,29 @@ public class JUnitTask extends Task {
             }
         }
 
-        File vmWatcher = createTempPropertiesFile("junitvmwatcher");
+        final File vmWatcher = createTempPropertiesFile("junitvmwatcher");
         cmd.createArgument().setValue(Constants.CRASHFILE
                                       + vmWatcher.getAbsolutePath());
-        File propsFile = createTempPropertiesFile("junit");
+        final File propsFile = createTempPropertiesFile("junit");
         cmd.createArgument().setValue(Constants.PROPSFILE
                                       + propsFile.getAbsolutePath());
-        Hashtable p = getProject().getProperties();
-        Properties props = new Properties();
-        for (Enumeration e = p.keys(); e.hasMoreElements();) {
-            Object key = e.nextElement();
+        final Hashtable p = getProject().getProperties();
+        final Properties props = new Properties();
+        for (final Enumeration e = p.keys(); e.hasMoreElements();) {
+            final Object key = e.nextElement();
             props.put(key, p.get(key));
         }
         try {
-            FileOutputStream outstream = new FileOutputStream(propsFile);
+            final FileOutputStream outstream = new FileOutputStream(propsFile);
             props.store(outstream, "Ant JUnitTask generated properties file");
             outstream.close();
-        } catch (java.io.IOException e) {
+        } catch (final java.io.IOException e) {
             FILE_UTILS.tryHardToDelete(propsFile);
             throw new BuildException("Error creating temporary properties "
                                      + "file.", e, getLocation());
         }
 
-        Execute execute = new Execute(
+        final Execute execute = new Execute(
             new JUnitLogStreamHandler(
                 this,
                 Project.MSG_INFO,
@@ -1240,7 +1238,7 @@ public class JUnitTask extends Task {
             execute.setWorkingDirectory(dir);
         }
 
-        String[] environment = env.getVariables();
+        final String[] environment = env.getVariables();
         if (environment != null) {
             for (int i = 0; i < environment.length; i++) {
                 log("Setting environment variable: " + environment[i],
@@ -1254,10 +1252,10 @@ public class JUnitTask extends Task {
 
         checkForkedPath(cmd);
 
-        TestResultHolder result = new TestResultHolder();
+        final TestResultHolder result = new TestResultHolder();
         try {
             result.exitCode = execute.execute();
-        } catch (IOException e) {
+        } catch (final IOException e) {
             throw new BuildException("Process fork failed.", e, getLocation());
         } finally {
             String vmCrashString = "unknown";
@@ -1272,7 +1270,7 @@ public class JUnitTask extends Task {
                             + ") missing, location not writable,"
                             + " testcase not started or mixing ant versions?";
                 }
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 e.printStackTrace();
                 // ignored.
             } finally {
@@ -1282,7 +1280,7 @@ public class JUnitTask extends Task {
                 }
             }
 
-            boolean crash = (watchdog != null && watchdog.killedProcess())
+            final boolean crash = (watchdog != null && watchdog.killedProcess())
                 || !Constants.TERMINATED_SUCCESSFULLY.equals(vmCrashString);
 
             if (casesFile != null && crash) {
@@ -1311,10 +1309,10 @@ public class JUnitTask extends Task {
      * Adding ant runtime.
      * @param cmd command to run
      */
-    private void checkIncludeAntRuntime(CommandlineJava cmd) {
+    private void checkIncludeAntRuntime(final CommandlineJava cmd) {
         if (includeAntRuntime) {
-            Map/*<String, String>*/ env = Execute.getEnvironmentVariables();
-            String cp = (String) env.get(CLASSPATH);
+            final Map/*<String, String>*/ env = Execute.getEnvironmentVariables();
+            final String cp = (String) env.get(CLASSPATH);
             if (cp != null) {
                 cmd.createClasspath(getProject()).createPath()
                     .append(new Path(getProject(), cp));
@@ -1332,11 +1330,11 @@ public class JUnitTask extends Task {
      * @param summaryOption the summary option -can be null
      * @return true if the run should be withoutput and error
      */
-    private boolean equalsWithOutAndErr(String summaryOption) {
+    private boolean equalsWithOutAndErr(final String summaryOption) {
         return "withoutanderr".equalsIgnoreCase(summaryOption);
     }
 
-    private void checkIncludeSummary(CommandlineJava cmd) {
+    private void checkIncludeSummary(final CommandlineJava cmd) {
         if (summary) {
             String prefix = "";
             if (equalsWithOutAndErr(summaryValue)) {
@@ -1354,7 +1352,7 @@ public class JUnitTask extends Task {
      * ant.
      * @param cmd command to execute
      */
-    private void checkForkedPath(CommandlineJava cmd) {
+    private void checkForkedPath(final CommandlineJava cmd) {
         if (forkedPathChecked) {
             return;
         }
@@ -1368,13 +1366,13 @@ public class JUnitTask extends Task {
                 AntClassLoader.newAntClassLoader(null, getProject(),
                                                  cmd.createClasspath(getProject()),
                                                  true);
-            String projectResourceName =
+            final String projectResourceName =
                 LoaderUtils.classNameToResource(Project.class.getName());
             URL previous = null;
             try {
-                for (Enumeration e = loader.getResources(projectResourceName);
+                for (final Enumeration e = loader.getResources(projectResourceName);
                      e.hasMoreElements();) {
-                    URL current = (URL) e.nextElement();
+                    final URL current = (URL) e.nextElement();
                     if (previous != null && !urlEquals(current, previous)) {
                         log("WARNING: multiple versions of ant detected "
                             + "in path for junit "
@@ -1385,7 +1383,7 @@ public class JUnitTask extends Task {
                     }
                     previous = current;
                 }
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 // Ignore exception
             }
         } finally {
@@ -1400,9 +1398,9 @@ public class JUnitTask extends Task {
      * account when comparing file URLs and ignores the jar specific
      * part of the URL if present.
      */
-    private static boolean urlEquals(URL u1, URL u2) {
-        String url1 = maybeStripJarAndClass(u1);
-        String url2 = maybeStripJarAndClass(u2);
+    private static boolean urlEquals(final URL u1, final URL u2) {
+        final String url1 = maybeStripJarAndClass(u1);
+        final String url2 = maybeStripJarAndClass(u2);
         if (url1.startsWith("file:") && url2.startsWith("file:")) {
             return new File(FILE_UTILS.fromURI(url1))
                 .equals(new File(FILE_UTILS.fromURI(url2)));
@@ -1410,10 +1408,10 @@ public class JUnitTask extends Task {
         return url1.equals(url2);
     }
 
-    private static String maybeStripJarAndClass(URL u) {
+    private static String maybeStripJarAndClass(final URL u) {
         String s = u.toString();
         if (s.startsWith("jar:")) {
-            int pling = s.indexOf('!');
+            final int pling = s.indexOf('!');
             s = s.substring(4, pling == -1 ? s.length() : pling);
         }
         return s;
@@ -1427,8 +1425,8 @@ public class JUnitTask extends Task {
      * @param prefix
      * @return created file
      */
-    private File createTempPropertiesFile(String prefix) {
-        File propsFile =
+    private File createTempPropertiesFile(final String prefix) {
+        final File propsFile =
             FILE_UTILS.createTempFile(prefix, ".properties",
                 tmpDir != null ? tmpDir : getProject().getBaseDir(), true, true);
         return propsFile;
@@ -1443,7 +1441,7 @@ public class JUnitTask extends Task {
      * @since Ant 1.5
      */
     @Override
-	protected void handleOutput(String output) {
+	protected void handleOutput(final String output) {
         if (output.startsWith(TESTLISTENER_PREFIX)) {
             log(output, Project.MSG_VERBOSE);
         } else if (runner != null) {
@@ -1473,7 +1471,7 @@ public class JUnitTask extends Task {
      * @since Ant 1.6
      */
     @Override
-	protected int handleInput(byte[] buffer, int offset, int length)
+	protected int handleInput(final byte[] buffer, final int offset, final int length)
         throws IOException {
         if (runner != null) {
             return runner.handleInput(buffer, offset, length);
@@ -1491,7 +1489,7 @@ public class JUnitTask extends Task {
      * @since Ant 1.5.2
      */
     @Override
-	protected void handleFlush(String output) {
+	protected void handleFlush(final String output) {
         if (runner != null) {
             runner.handleFlush(output);
             if (showOutput) {
@@ -1510,7 +1508,7 @@ public class JUnitTask extends Task {
      * @since Ant 1.5
      */
     @Override
-	public void handleErrorOutput(String output) {
+	public void handleErrorOutput(final String output) {
         if (runner != null) {
             runner.handleErrorOutput(output);
             if (showOutput) {
@@ -1530,7 +1528,7 @@ public class JUnitTask extends Task {
      * @since Ant 1.5.2
      */
     @Override
-	public void handleErrorFlush(String output) {
+	public void handleErrorFlush(final String output) {
         if (runner != null) {
             runner.handleErrorFlush(output);
             if (showOutput) {
@@ -1551,12 +1549,12 @@ public class JUnitTask extends Task {
      * @throws BuildException under unspecified circumstances
      * @return the results
      */
-    private TestResultHolder executeInVM(JUnitTest arg) throws BuildException {
+    private TestResultHolder executeInVM(final JUnitTest arg) throws BuildException {
         if (delegate == null) {
             setupJUnitDelegate();
         }
 
-        JUnitTest test = (JUnitTest) arg.clone();
+        final JUnitTest test = (JUnitTest) arg.clone();
         test.setProperties(getProject().getProperties());
         if (dir != null) {
             log("dir attribute ignored if running in the same VM",
@@ -1573,7 +1571,7 @@ public class JUnitTask extends Task {
                 Project.MSG_WARN);
         }
 
-        CommandlineJava.SysProperties sysProperties =
+        final CommandlineJava.SysProperties sysProperties =
                 getCommandline().getSystemProperties();
         if (sysProperties != null) {
             sysProperties.setSystem();
@@ -1597,7 +1595,7 @@ public class JUnitTask extends Task {
                                          classLoader);
             if (summary) {
 
-                JUnitTaskMirror.SummaryJUnitResultFormatterMirror f =
+                final JUnitTaskMirror.SummaryJUnitResultFormatterMirror f =
                     delegate.newSummaryJUnitResultFormatter();
                 f.setWithOutAndErr(equalsWithOutAndErr(summaryValue));
                 f.setOutput(getDefaultOutput());
@@ -1608,9 +1606,9 @@ public class JUnitTask extends Task {
 
             final FormatterElement[] feArray = mergeFormatters(test);
             for (int i = 0; i < feArray.length; i++) {
-                FormatterElement fe = feArray[i];
+                final FormatterElement fe = feArray[i];
                 if (fe.shouldUse(this)) {
-                    File outFile = getOutput(fe, test);
+                    final File outFile = getOutput(fe, test);
                     if (outFile != null) {
                         fe.setOutfile(outFile);
                     } else {
@@ -1621,7 +1619,7 @@ public class JUnitTask extends Task {
             }
 
             runner.run();
-            TestResultHolder result = new TestResultHolder();
+            final TestResultHolder result = new TestResultHolder();
             result.exitCode = runner.getRetCode();
             return result;
         } finally {
@@ -1669,7 +1667,7 @@ public class JUnitTask extends Task {
         final int count = batchTests.size();
         final Enumeration[] enums = new Enumeration[ count + 1];
         for (int i = 0; i < count; i++) {
-            BatchTest batchtest = batchTests.elementAt(i);
+            final BatchTest batchtest = batchTests.elementAt(i);
             enums[i] = batchtest.elements();
         }
         enums[enums.length - 1] = tests.elements();
@@ -1690,9 +1688,9 @@ public class JUnitTask extends Task {
             return;
         }
 
-        Enumeration<JUnitTest> testsEnum = tests.elements();
+        final Enumeration<JUnitTest> testsEnum = tests.elements();
         while (testsEnum.hasMoreElements()) {
-            JUnitTest test = testsEnum.nextElement();
+            final JUnitTest test = testsEnum.nextElement();
             if (test.hasMethodsSpecified() && test.shouldRun(getProject())) {
                 test.resolveMethods();
             }
@@ -1705,7 +1703,7 @@ public class JUnitTask extends Task {
      * @since Ant 1.3
      */
     protected Enumeration<JUnitTest> allTests() {
-        Enumeration[] enums = {tests.elements(), batchTests.elements()};
+        final Enumeration[] enums = {tests.elements(), batchTests.elements()};
         return Enumerations.fromCompound(enums);
     }
 
@@ -1714,10 +1712,10 @@ public class JUnitTask extends Task {
      * @return array of FormatterElement
      * @since Ant 1.3
      */
-    private FormatterElement[] mergeFormatters(JUnitTest test) {
-        Vector<FormatterElement> feVector = (Vector<FormatterElement>) formatters.clone();
+    private FormatterElement[] mergeFormatters(final JUnitTest test) {
+        final Vector<FormatterElement> feVector = (Vector<FormatterElement>) formatters.clone();
         test.addFormattersTo(feVector);
-        FormatterElement[] feArray = new FormatterElement[feVector.size()];
+        final FormatterElement[] feArray = new FormatterElement[feVector.size()];
         feVector.copyInto(feArray);
         return feArray;
     }
@@ -1730,15 +1728,15 @@ public class JUnitTask extends Task {
      * @return file reference
      * @since Ant 1.3
      */
-    protected File getOutput(FormatterElement fe, JUnitTest test) {
+    protected File getOutput(final FormatterElement fe, final JUnitTest test) {
         if (fe.getUseFile()) {
             String base = test.getOutfile();
             if (base == null) {
                 base = JUnitTaskMirror.JUnitTestRunnerMirror.IGNORED_FILE_NAME;
             }
-            String filename = base + fe.getExtension();
-            File destFile = new File(test.getTodir(), filename);
-            String absFilename = destFile.getAbsolutePath();
+            final String filename = base + fe.getExtension();
+            final File destFile = new File(test.getTodir(), filename);
+            final String absFilename = destFile.getAbsolutePath();
             return getProject().resolveFile(absFilename);
         }
         return null;
@@ -1754,7 +1752,7 @@ public class JUnitTask extends Task {
      * @param resource resource that one wants to lookup
      * @since Ant 1.4
      */
-    protected void addClasspathEntry(String resource) {
+    protected void addClasspathEntry(final String resource) {
         addClasspathResource(resource);
     }
 
@@ -1782,7 +1780,7 @@ public class JUnitTask extends Task {
                 + resource;
         }
 
-        File f = LoaderUtils.getResourceSource(JUnitTask.class.getClassLoader(),
+        final File f = LoaderUtils.getResourceSource(JUnitTask.class.getClassLoader(),
                                                resource);
         if (f != null) {
             log("Found " + f.getAbsolutePath(), Project.MSG_DEBUG);
@@ -1804,8 +1802,8 @@ public class JUnitTask extends Task {
      *
      * @since Ant 1.5.2
      */
-    private void logTimeout(FormatterElement[] feArray, JUnitTest test,
-                            String testCase) {
+    private void logTimeout(final FormatterElement[] feArray, final JUnitTest test,
+                            final String testCase) {
         logVmExit(feArray, test, TIMEOUT_MESSAGE, testCase);
     }
 
@@ -1816,7 +1814,7 @@ public class JUnitTask extends Task {
      *
      * @since Ant 1.7
      */
-    private void logVmCrash(FormatterElement[] feArray, JUnitTest test, String testCase) {
+    private void logVmCrash(final FormatterElement[] feArray, final JUnitTest test, final String testCase) {
         logVmExit(
             feArray, test,
             "Forked Java VM exited abnormally. Please note the time in the report"
@@ -1830,8 +1828,8 @@ public class JUnitTask extends Task {
      *
      * @since Ant 1.7
      */
-    private void logVmExit(FormatterElement[] feArray, JUnitTest test,
-                           String message, String testCase) {
+    private void logVmExit(final FormatterElement[] feArray, final JUnitTest test,
+                           final String message, final String testCase) {
         if (delegate == null) {
             setupJUnitDelegate();
         }
@@ -1851,17 +1849,17 @@ public class JUnitTask extends Task {
             test.setCounts(1, 0, 1, 0);
             test.setProperties(getProject().getProperties());
             for (int i = 0; i < feArray.length; i++) {
-                FormatterElement fe = feArray[i];
+                final FormatterElement fe = feArray[i];
                 if (fe.shouldUse(this)) {
-                    JUnitTaskMirror.JUnitResultFormatterMirror formatter =
+                    final JUnitTaskMirror.JUnitResultFormatterMirror formatter =
                         fe.createFormatter(classLoader);
                     if (formatter != null) {
                         OutputStream out = null;
-                        File outFile = getOutput(fe, test);
+                        final File outFile = getOutput(fe, test);
                         if (outFile != null) {
                             try {
                                 out = new FileOutputStream(outFile);
-                            } catch (IOException e) {
+                            } catch (final IOException e) {
                                 // ignore
                             }
                         }
@@ -1874,7 +1872,7 @@ public class JUnitTask extends Task {
                 }
             }
             if (summary) {
-                JUnitTaskMirror.SummaryJUnitResultFormatterMirror f =
+                final JUnitTaskMirror.SummaryJUnitResultFormatterMirror f =
                     delegate.newSummaryJUnitResultFormatter();
                 f.setWithOutAndErr(equalsWithOutAndErr(summaryValue));
                 delegate.addVmExit(test, f, getDefaultOutput(), message, testCase);
@@ -1893,11 +1891,11 @@ public class JUnitTask extends Task {
      * @since Ant 1.6
      */
     private void createClassLoader() {
-        Path userClasspath = getCommandline().getClasspath();
+        final Path userClasspath = getCommandline().getClasspath();
         if (userClasspath != null) {
             if (reloading || classLoader == null) {
                 deleteClassLoader();
-                Path classpath = (Path) userClasspath.clone();
+                final Path classpath = (Path) userClasspath.clone();
                 if (includeAntRuntime) {
                     log("Implicitly adding " + antRuntimeClasses
                         + " to CLASSPATH", Project.MSG_VERBOSE);
@@ -1969,11 +1967,11 @@ public class JUnitTask extends Task {
      * @since Ant 1.6.2
      */
     private static final class ForkedTestConfiguration {
-        private boolean filterTrace;
-        private boolean haltOnError;
-        private boolean haltOnFailure;
-        private String errorProperty;
-        private String failureProperty;
+        private final boolean filterTrace;
+        private final boolean haltOnError;
+        private final boolean haltOnFailure;
+        private final String errorProperty;
+        private final String failureProperty;
 
         /**
          * constructor for forked test configuration
@@ -1983,9 +1981,9 @@ public class JUnitTask extends Task {
          * @param errorProperty
          * @param failureProperty
          */
-        ForkedTestConfiguration(boolean filterTrace, boolean haltOnError,
-                                boolean haltOnFailure, String errorProperty,
-                                String failureProperty) {
+        ForkedTestConfiguration(final boolean filterTrace, final boolean haltOnError,
+                                final boolean haltOnFailure, final String errorProperty,
+                                final String failureProperty) {
             this.filterTrace = filterTrace;
             this.haltOnError = haltOnError;
             this.haltOnFailure = haltOnFailure;
@@ -1997,7 +1995,7 @@ public class JUnitTask extends Task {
          * configure from a test; sets member variables to attributes of the test
          * @param test
          */
-        ForkedTestConfiguration(JUnitTest test) {
+        ForkedTestConfiguration(final JUnitTest test) {
             this(test.getFiltertrace(),
                     test.getHaltonerror(),
                     test.getHaltonfailure(),
@@ -2011,12 +2009,12 @@ public class JUnitTask extends Task {
          * @return true if everything is equal
          */
         @Override
-		public boolean equals(Object other) {
+		public boolean equals(final Object other) {
             if (other == null
                 || other.getClass() != ForkedTestConfiguration.class) {
                 return false;
             }
-            ForkedTestConfiguration o = (ForkedTestConfiguration) other;
+            final ForkedTestConfiguration o = (ForkedTestConfiguration) other;
             return filterTrace == o.filterTrace
                 && haltOnError == o.haltOnError
                 && haltOnFailure == o.haltOnFailure
@@ -2073,7 +2071,7 @@ public class JUnitTask extends Task {
          * Constructor using a value.
          * @param value the value to use - once, perTest or perBatch.
          */
-        public ForkMode(String value) {
+        public ForkMode(final String value) {
             super();
             setValue(value);
         }
@@ -2095,18 +2093,18 @@ public class JUnitTask extends Task {
      * @return a list of tasks to be executed.
      * @since 1.6.2
      */
-    protected Collection<List> executeOrQueue(Enumeration<JUnitTest> testList,
-                                        boolean runIndividual) {
-        Map<ForkedTestConfiguration, List> testConfigurations = new HashMap<ForkedTestConfiguration, List>();
+    protected Collection<List> executeOrQueue(final Enumeration<JUnitTest> testList,
+                                        final boolean runIndividual) {
+        final Map<ForkedTestConfiguration, List> testConfigurations = new HashMap<ForkedTestConfiguration, List>();
         while (testList.hasMoreElements()) {
-            JUnitTest test = testList.nextElement();
+            final JUnitTest test = testList.nextElement();
             if (test.shouldRun(getProject())) {
                 /* with multi-threaded runs need to defer execution of even */
                 /* individual tests so the threads can pick tests off the queue. */
                 if ((runIndividual || !test.getFork()) && (threads == 1)) {
                     execute(test, 0);
                 } else {
-                    ForkedTestConfiguration c =
+                    final ForkedTestConfiguration c =
                         new ForkedTestConfiguration(test);
                     List<JUnitTest> l = testConfigurations.get(c);
                     if (l == null) {
@@ -2130,9 +2128,9 @@ public class JUnitTask extends Task {
      * @param name      the name of the test.
      * @since Ant 1.6.2
      */
-    protected void actOnTestResult(int exitValue, boolean wasKilled,
-                                   JUnitTest test, String name) {
-        TestResultHolder t = new TestResultHolder();
+    protected void actOnTestResult(final int exitValue, final boolean wasKilled,
+                                   final JUnitTest test, final String name) {
+        final TestResultHolder t = new TestResultHolder();
         t.exitCode = exitValue;
         t.timedOut = wasKilled;
         actOnTestResult(t, test, name);
@@ -2147,14 +2145,14 @@ public class JUnitTask extends Task {
      * @param name      the name of the test.
      * @since Ant 1.7
      */
-    protected void actOnTestResult(TestResultHolder result, JUnitTest test,
-                                   String name) {
+    protected void actOnTestResult(final TestResultHolder result, final JUnitTest test,
+                                   final String name) {
         // if there is an error/failure and that it should halt, stop
         // everything otherwise just log a statement
-        boolean fatal = result.timedOut || result.crashed;
-        boolean errorOccurredHere =
+        final boolean fatal = result.timedOut || result.crashed;
+        final boolean errorOccurredHere =
             result.exitCode == JUnitTaskMirror.JUnitTestRunnerMirror.ERRORS || fatal;
-        boolean failureOccurredHere =
+        final boolean failureOccurredHere =
             result.exitCode != JUnitTaskMirror.JUnitTestRunnerMirror.SUCCESS || fatal;
         if (errorOccurredHere || failureOccurredHere) {
             if ((errorOccurredHere && test.getHaltonerror())
@@ -2198,14 +2196,14 @@ public class JUnitTask extends Task {
      * @since Ant 1.7
      */
     protected static class JUnitLogOutputStream extends LogOutputStream {
-        private Task task; // local copy since LogOutputStream.task is private
+        private final Task task; // local copy since LogOutputStream.task is private
 
         /**
          * Constructor.
          * @param task the task being logged.
          * @param level the log level used to log data written to this stream.
          */
-        public JUnitLogOutputStream(Task task, int level) {
+        public JUnitLogOutputStream(final Task task, final int level) {
             super(task, level);
             this.task = task;
         }
@@ -2218,7 +2216,7 @@ public class JUnitTask extends Task {
          * @param level the logging level to use.
          */
         @Override
-		protected void processLine(String line, int level) {
+		protected void processLine(final String line, final int level) {
             if (line.startsWith(TESTLISTENER_PREFIX)) {
                 task.log(line, Project.MSG_VERBOSE);
             } else {
@@ -2238,7 +2236,7 @@ public class JUnitTask extends Task {
          * @param outlevel the level to use for standard output.
          * @param errlevel the level to use for error output.
          */
-        public JUnitLogStreamHandler(Task task, int outlevel, int errlevel) {
+        public JUnitLogStreamHandler(final Task task, final int outlevel, final int errlevel) {
             super(new JUnitLogOutputStream(task, outlevel),
                   new LogOutputStream(task, errlevel));
         }
@@ -2260,23 +2258,23 @@ public class JUnitTask extends Task {
      *
      * @see https://issues.apache.org/bugzilla/show_bug.cgi?id=45227
      */
-    private static JUnitTest createDummyTestForBatchTest(JUnitTest test) {
-        JUnitTest t = (JUnitTest) test.clone();
-        int index = test.getName().lastIndexOf('.');
+    private static JUnitTest createDummyTestForBatchTest(final JUnitTest test) {
+        final JUnitTest t = (JUnitTest) test.clone();
+        final int index = test.getName().lastIndexOf('.');
         // make sure test looks as if it was in the same "package" as
         // the last test of the batch
-        String pack = index > 0 ? test.getName().substring(0, index + 1) : "";
+        final String pack = index > 0 ? test.getName().substring(0, index + 1) : "";
         t.setName(pack + NAME_OF_DUMMY_TEST);
         return t;
     }
 
-    private static void printDual(BufferedWriter w, PrintStream s, String text)
+    private static void printDual(final BufferedWriter w, final PrintStream s, final String text)
         throws IOException {
         w.write(String.valueOf(text));
         s.print(text);
     }
 
-    private static void printlnDual(BufferedWriter w, PrintStream s, String text)
+    private static void printlnDual(final BufferedWriter w, final PrintStream s, final String text)
         throws IOException {
         w.write(String.valueOf(text));
         w.newLine();

http://git-wip-us.apache.org/repos/asf/ant/blob/13f6d98c/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
index 515e65d..12a3acf 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
@@ -355,7 +355,6 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
     /**
      * Run the test.
      */
-    @Override
 	public void run() {
         res = new IgnoredTestResult();
         res.addListener(wrapListener(this));
@@ -678,7 +677,6 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
      *
      * @return 2 if errors occurred, 1 if tests failed else 0.
      */
-    @Override
 	public int getRetCode() {
         return retCode;
     }
@@ -689,7 +687,6 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
      * <p>A new Test is started.
      * @param t the test.
      */
-    @Override
 	public void startTest(final Test t) {
         final String testName = JUnitVersionHelper.getTestCaseName(t);
         logTestListenerEvent("startTest(" + testName + ")");
@@ -701,7 +698,6 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
      * <p>A Test is finished.
      * @param test the test.
      */
-    @Override
 	public void endTest(final Test test) {
         final String testName = JUnitVersionHelper.getTestCaseName(test);
         logTestListenerEvent("endTest(" + testName + ")");
@@ -745,7 +741,6 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
      * @param test the test.
      * @param t    the assertion thrown by the test.
      */
-    @Override
 	public void addFailure(final Test test, final AssertionFailedError t) {
         addFailure(test, (Throwable) t);
     }
@@ -757,7 +752,6 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
      * @param test the test.
      * @param t    the error thrown by the test.
      */
-    @Override
 	public void addError(final Test test, final Throwable t) {
         final String testName = JUnitVersionHelper.getTestCaseName(test);
         logTestListenerEvent("addError(" + testName + ", " + t.getMessage() + ")");
@@ -771,7 +765,6 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
      * @since Ant 1.6
      * @param permissions the permissions to use.
      */
-    @Override
 	public void setPermissions(final Permissions permissions) {
         perm = permissions;
     }
@@ -780,7 +773,6 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
      * Handle a string destined for standard output.
      * @param output the string to output
      */
-    @Override
 	public void handleOutput(final String output) {
         if (!logTestListenerEvents && output.startsWith(JUnitTask.TESTLISTENER_PREFIX)) {
             // ignore
@@ -800,14 +792,12 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
      *
      * @since Ant 1.6
      */
-    @Override
 	public int handleInput(final byte[] buffer, final int offset, final int length)
         throws IOException {
         return -1;
     }
 
     /** {@inheritDoc}. */
-    @Override
 	public void handleErrorOutput(final String output) {
         if (systemError != null) {
             systemError.print(output);
@@ -815,7 +805,6 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
     }
 
     /** {@inheritDoc}. */
-    @Override
 	public void handleFlush(final String output) {
         if (systemOut != null) {
             systemOut.print(output);
@@ -823,7 +812,6 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
     }
 
     /** {@inheritDoc}. */
-    @Override
 	public void handleErrorFlush(final String output) {
         if (systemError != null) {
             systemError.print(output);
@@ -866,7 +854,6 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
     }
 
     /** {@inheritDoc}. */
-    @Override
 	public void addFormatter(final JUnitTaskMirror.JUnitResultFormatterMirror f) {
         formatters.addElement(f);
     }
@@ -1058,39 +1045,30 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR
                                            final JUnitTest test) {
         runner.addFormatter(new JUnitResultFormatter() {
 
-            @Override
 			public void startTestSuite(final JUnitTest suite) throws BuildException {
             }
 
-            @Override
 			public void endTestSuite(final JUnitTest suite) throws BuildException {
             }
 
-            @Override
 			public void setOutput(final OutputStream out) {
             }
 
-            @Override
 			public void setSystemOutput(final String out) {
             }
 
-            @Override
 			public void setSystemError(final String err) {
             }
 
-            @Override
 			public void addError(final Test arg0, final Throwable arg1) {
             }
 
-            @Override
 			public void addFailure(final Test arg0, final AssertionFailedError arg1) {
             }
 
-            @Override
 			public void endTest(final Test arg0) {
             }
 
-            @Override
 			public void startTest(final Test arg0) {
                 registerTestCase(JUnitVersionHelper.getTestCaseName(arg0));
             }

http://git-wip-us.apache.org/repos/asf/ant/blob/13f6d98c/src/main/org/apache/tools/ant/taskdefs/optional/junit/TearDownOnVmCrash.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/TearDownOnVmCrash.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/TearDownOnVmCrash.java
index 4d6f9af..5689ac1 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/TearDownOnVmCrash.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/TearDownOnVmCrash.java
@@ -43,7 +43,6 @@ public class TearDownOnVmCrash implements JUnitResultFormatter {
      * Records the suite's name to later determine the class to invoke
      * tearDown on.
      */
-    @Override
 	public void startTestSuite(final JUnitTest suite) {
         suiteName = suite.getName();
         if (suiteName != null &&
@@ -58,7 +57,6 @@ public class TearDownOnVmCrash implements JUnitResultFormatter {
      * test we get when a Batch fails and the error is an actual
      * error generated by Ant.
      */
-    @Override
 	public void addError(final Test fakeTest, final Throwable t) {
         if (suiteName != null
             && fakeTest instanceof JUnitTaskMirrorImpl.VmExitErrorTest) {
@@ -69,25 +67,18 @@ public class TearDownOnVmCrash implements JUnitResultFormatter {
     // no need to implement the rest
     public void addFailure(Test test, Throwable t) {}
 
-    @Override
 	public void addFailure(Test test, AssertionFailedError t) {}
 
-    @Override
 	public void startTest(Test test) {}
 
-    @Override
 	public void endTest(Test test) {}
 
-    @Override
 	public void endTestSuite(JUnitTest suite) {}
 
-    @Override
 	public void setOutput(OutputStream out) {}
 
-    @Override
 	public void setSystemOutput(String out) {}
 
-    @Override
 	public void setSystemError(String err) {}
 
     private void tearDown() {

http://git-wip-us.apache.org/repos/asf/ant/blob/13f6d98c/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java
index 2a93474..7b4ffbc 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java
@@ -109,19 +109,16 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan
     }
 
     /** {@inheritDoc}. */
-    @Override
 	public void setOutput(OutputStream out) {
         this.out = out;
     }
 
     /** {@inheritDoc}. */
-    @Override
 	public void setSystemOutput(String out) {
         formatOutput(SYSTEM_OUT, out);
     }
 
     /** {@inheritDoc}. */
-    @Override
 	public void setSystemError(String out) {
         formatOutput(SYSTEM_ERR, out);
     }
@@ -130,7 +127,6 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan
      * The whole testsuite started.
      * @param suite the testsuite.
      */
-    @Override
 	public void startTestSuite(JUnitTest suite) {
         doc = getDocumentBuilder().newDocument();
         rootElement = doc.createElement(TESTSUITE);
@@ -182,7 +178,6 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan
      * @param suite the testsuite.
      * @throws BuildException on error.
      */
-    @Override
 	public void endTestSuite(JUnitTest suite) throws BuildException {
         rootElement.setAttribute(ATTR_TESTS, "" + suite.runCount());
         rootElement.setAttribute(ATTR_FAILURES, "" + suite.failureCount());
@@ -219,7 +214,6 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan
      * <p>A new Test is started.
      * @param t the test.
      */
-    @Override
 	public void startTest(Test t) {
         testStarts.put(createDescription(t), System.currentTimeMillis());
     }
@@ -234,7 +228,6 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan
      * <p>A Test is finished.
      * @param test the test.
      */
-    @Override
 	public void endTest(Test test) {
         String testDescription = createDescription(test);
 
@@ -283,7 +276,6 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan
      * @param test the test.
      * @param t the assertion.
      */
-    @Override
 	public void addFailure(Test test, AssertionFailedError t) {
         addFailure(test, (Throwable) t);
     }
@@ -295,7 +287,6 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan
      * @param test the test.
      * @param t the error.
      */
-    @Override
 	public void addError(Test test, Throwable t) {
         formatError(ERROR, test, t);
     }
@@ -333,7 +324,6 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan
         nested.appendChild(doc.createCDATASection(output));
     }
 
-    @Override
 	public void testIgnored(Test test) {
         formatSkip(test, JUnitVersionHelper.getIgnoreMessage(test));
         if (test != null) {
@@ -364,7 +354,6 @@ public class XMLJUnitResultFormatter implements JUnitResultFormatter, XMLConstan
 
     }
 
-    @Override
 	public void testAssumptionFailure(Test test, Throwable failure) {
         formatSkip(test, failure.getMessage());
         skippedTests.put(createDescription(test), test);

http://git-wip-us.apache.org/repos/asf/ant/blob/13f6d98c/src/main/org/apache/tools/ant/types/mappers/CutDirsMapper.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/types/mappers/CutDirsMapper.java b/src/main/org/apache/tools/ant/types/mappers/CutDirsMapper.java
index 3c2fcbf..4684a9f 100644
--- a/src/main/org/apache/tools/ant/types/mappers/CutDirsMapper.java
+++ b/src/main/org/apache/tools/ant/types/mappers/CutDirsMapper.java
@@ -46,7 +46,6 @@ public class CutDirsMapper implements FileNameMapper {
      * Empty implementation.
      * @param ignore ignored.
      */
-    @Override
 	public void setFrom(final String ignore) {
     }
 
@@ -54,12 +53,10 @@ public class CutDirsMapper implements FileNameMapper {
      * Empty implementation.
      * @param ignore ignored.
      */
-    @Override
 	public void setTo(final String ignore) {
     }
 
     /** {@inheritDoc}. */
-    @Override
 	public String[] mapFileName(final String sourceFileName) {
         if (dirs <= 0) {
             throw new BuildException("dirs must be set to a positive number");

http://git-wip-us.apache.org/repos/asf/ant/blob/13f6d98c/src/main/org/apache/tools/ant/types/resources/Archives.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/types/resources/Archives.java b/src/main/org/apache/tools/ant/types/resources/Archives.java
index 943cfd1..d7b3127 100644
--- a/src/main/org/apache/tools/ant/types/resources/Archives.java
+++ b/src/main/org/apache/tools/ant/types/resources/Archives.java
@@ -72,14 +72,13 @@ public class Archives extends DataType
     /**
      * Sums the sizes of nested archives.
      */
-    @Override
 	public int size() {
         if (isReference()) {
             return ((Archives) getCheckedRef()).size();
         }
         dieOnCircularReference();
         int total = 0;
-        for (Iterator<ArchiveFileSet> i = grabArchives(); i.hasNext();) {
+        for (final Iterator<ArchiveFileSet> i = grabArchives(); i.hasNext();) {
             total += i.next().size();
         }
         return total;
@@ -88,14 +87,13 @@ public class Archives extends DataType
     /**
      * Merges the nested collections.
      */
-    @Override
 	public Iterator<Resource> iterator() {
         if (isReference()) {
             return ((Archives) getCheckedRef()).iterator();
         }
         dieOnCircularReference();
-        List<Resource> l = new LinkedList<Resource>();
-        for (Iterator<ArchiveFileSet> i = grabArchives(); i.hasNext();) {
+        final List<Resource> l = new LinkedList<Resource>();
+        for (final Iterator<ArchiveFileSet> i = grabArchives(); i.hasNext();) {
             l.addAll(CollectionUtils
                      .asCollection(i.next().iterator()));
         }
@@ -105,7 +103,6 @@ public class Archives extends DataType
     /**
      * @return false
      */
-    @Override
 	public boolean isFilesystemOnly() {
         if (isReference()) {
             return ((Archives) getCheckedRef()).isFilesystemOnly();
@@ -119,7 +116,7 @@ public class Archives extends DataType
      * @param r the Reference to set.
      */
     @Override
-	public void setRefid(Reference r) {
+	public void setRefid(final Reference r) {
         if (zips.getResourceCollections().size() > 0
             || tars.getResourceCollections().size() > 0) {
             throw tooManyAttributes();
@@ -135,11 +132,11 @@ public class Archives extends DataType
     @Override
 	public Object clone() {
         try {
-            Archives a = (Archives) super.clone();
+            final Archives a = (Archives) super.clone();
             a.zips = (Union) zips.clone();
             a.tars = (Union) tars.clone();
             return a;
-        } catch (CloneNotSupportedException e) {
+        } catch (final CloneNotSupportedException e) {
             throw new BuildException(e);
         }
     }
@@ -151,11 +148,11 @@ public class Archives extends DataType
      * and returns an iterator over the collected archives.
      */
     protected Iterator<ArchiveFileSet> grabArchives() {
-        List<ArchiveFileSet> l = new LinkedList<ArchiveFileSet>();
-        for (Resource r : zips) {
+        final List<ArchiveFileSet> l = new LinkedList<ArchiveFileSet>();
+        for (final Resource r : zips) {
             l.add(configureArchive(new ZipFileSet(), r));
         }
-        for (Resource r : tars) {
+        for (final Resource r : tars) {
             l.add(configureArchive(new TarFileSet(), r));
         }
         return l.iterator();
@@ -165,8 +162,8 @@ public class Archives extends DataType
      * Configures the archivefileset based on this type's settings,
      * set the source.
      */
-    protected ArchiveFileSet configureArchive(ArchiveFileSet afs,
-                                              Resource src) {
+    protected ArchiveFileSet configureArchive(final ArchiveFileSet afs,
+                                              final Resource src) {
         afs.setProject(getProject());
         afs.setSrcResource(src);
         return afs;
@@ -180,7 +177,7 @@ public class Archives extends DataType
      * @throws BuildException on error.
      */
     @Override
-	protected synchronized void dieOnCircularReference(Stack<Object> stk, Project p)
+	protected synchronized void dieOnCircularReference(final Stack<Object> stk, final Project p)
         throws BuildException {
         if (isChecked()) {
             return;

http://git-wip-us.apache.org/repos/asf/ant/blob/13f6d98c/src/main/org/apache/tools/ant/types/resources/ContentTransformingResource.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/types/resources/ContentTransformingResource.java b/src/main/org/apache/tools/ant/types/resources/ContentTransformingResource.java
index b4d6de0..d73193f 100644
--- a/src/main/org/apache/tools/ant/types/resources/ContentTransformingResource.java
+++ b/src/main/org/apache/tools/ant/types/resources/ContentTransformingResource.java
@@ -46,7 +46,7 @@ public abstract class ContentTransformingResource extends ResourceDecorator {
      * Constructor with another resource to wrap.
      * @param other the resource to wrap.
      */
-    protected ContentTransformingResource(ResourceCollection other) {
+    protected ContentTransformingResource(final ResourceCollection other) {
         super(other);
     }
 
@@ -61,14 +61,14 @@ public abstract class ContentTransformingResource extends ResourceDecorator {
             InputStream in = null;
             try {
                 in = getInputStream();
-                byte[] buf = new byte[BUFFER_SIZE];
+                final byte[] buf = new byte[BUFFER_SIZE];
                 int size = 0;
                 int readNow;
                 while ((readNow = in.read(buf, 0, buf.length)) > 0) {
                     size += readNow;
                 }
                 return size;
-            } catch (IOException ex) {
+            } catch (final IOException ex) {
                 throw new BuildException("caught exception while reading "
                                          + getName(), ex);
             } finally {
@@ -117,14 +117,13 @@ public abstract class ContentTransformingResource extends ResourceDecorator {
      * Suppress FileProvider, re-implement Appendable
      */
     @Override
-	public <T> T as(Class<T> clazz) {
+	public <T> T as(final Class<T> clazz) {
         if (Appendable.class.isAssignableFrom(clazz)) {
             if (isAppendSupported()) {
                 final Appendable a =
                     getResource().as(Appendable.class);
                 if (a != null) {
                     return clazz.cast(new Appendable() {
-                        @Override
 						public OutputStream getAppendOutputStream()
                                 throws IOException {
                             OutputStream out = a.getAppendOutputStream();

http://git-wip-us.apache.org/repos/asf/ant/blob/13f6d98c/src/main/org/apache/tools/ant/types/resources/LazyResourceCollectionWrapper.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/types/resources/LazyResourceCollectionWrapper.java b/src/main/org/apache/tools/ant/types/resources/LazyResourceCollectionWrapper.java
index 4bb72b9..bea172a 100644
--- a/src/main/org/apache/tools/ant/types/resources/LazyResourceCollectionWrapper.java
+++ b/src/main/org/apache/tools/ant/types/resources/LazyResourceCollectionWrapper.java
@@ -56,7 +56,7 @@ public class LazyResourceCollectionWrapper extends
 	protected int getSize() {
         // to compute the size, just iterate: the iterator will take care of
         // caching
-        Iterator<Resource> it = createIterator();
+        final Iterator<Resource> it = createIterator();
         int size = 0;
         while (it.hasNext()) {
             it.next();
@@ -72,7 +72,7 @@ public class LazyResourceCollectionWrapper extends
      * @param r resource considered for filtration
      * @return whether the resource should be filtered or not
      */
-    protected boolean filterResource(Resource r) {
+    protected boolean filterResource(final Resource r) {
         return false;
     }
 
@@ -84,11 +84,10 @@ public class LazyResourceCollectionWrapper extends
 
         protected final Iterator<Resource> it;
 
-        public FilteringIterator(Iterator<Resource> it) {
+        public FilteringIterator(final Iterator<Resource> it) {
             this.it = it;
         }
 
-        @Override
 		public boolean hasNext() {
             if (ended) {
                 return false;
@@ -106,17 +105,15 @@ public class LazyResourceCollectionWrapper extends
             return true;
         }
 
-        @Override
 		public Resource next() {
             if (!hasNext()) {
                 throw new UnsupportedOperationException();
             }
-            Resource r = next;
+            final Resource r = next;
             next = null;
             return r;
         }
 
-        @Override
 		public void remove() {
             throw new UnsupportedOperationException();
         }
@@ -139,11 +136,10 @@ public class LazyResourceCollectionWrapper extends
          *            the iterator which will provide the resources to put in
          *            cache
          */
-        public CachedIterator(Iterator<Resource> it) {
+        public CachedIterator(final Iterator<Resource> it) {
             this.it = it;
         }
 
-        @Override
 		public boolean hasNext() {
             synchronized (cachedResources) {
                 // have we already cached the next entry ?
@@ -155,13 +151,12 @@ public class LazyResourceCollectionWrapper extends
                     return false;
                 }
                 // put in cache the next resource
-                Resource r = it.next();
+                final Resource r = it.next();
                 cachedResources.add(r);
             }
             return true;
         }
 
-        @Override
 		public Resource next() {
             // first check that we have some to deliver
             if (!hasNext()) {
@@ -174,7 +169,6 @@ public class LazyResourceCollectionWrapper extends
             }
         }
 
-        @Override
 		public void remove() {
             throw new UnsupportedOperationException();
         }

http://git-wip-us.apache.org/repos/asf/ant/blob/13f6d98c/src/main/org/apache/tools/ant/types/resources/MultiRootFileSet.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/types/resources/MultiRootFileSet.java b/src/main/org/apache/tools/ant/types/resources/MultiRootFileSet.java
index 8c02578..85c1d45 100644
--- a/src/main/org/apache/tools/ant/types/resources/MultiRootFileSet.java
+++ b/src/main/org/apache/tools/ant/types/resources/MultiRootFileSet.java
@@ -44,7 +44,7 @@ public class MultiRootFileSet extends AbstractFileSet
     private Union union;
 
     @Override
-	public void setDir(File dir) {
+	public void setDir(final File dir) {
         throw new BuildException(getDataTypeName()
                                  + " doesn't support the dir attribute");
     }
@@ -53,7 +53,7 @@ public class MultiRootFileSet extends AbstractFileSet
      * Determines the types of resources to return.
      * @param type the types of resources to return
      */
-    public void setType(SetType type) {
+    public void setType(final SetType type) {
         if (isReference()) {
             throw tooManyAttributes();
         }
@@ -64,7 +64,7 @@ public class MultiRootFileSet extends AbstractFileSet
      * Set whether to cache collections.
      * @param b boolean cache flag.
      */
-    public synchronized void setCache(boolean b) {
+    public synchronized void setCache(final boolean b) {
         if (isReference()) {
             throw tooManyAttributes();
         }
@@ -75,13 +75,13 @@ public class MultiRootFileSet extends AbstractFileSet
      * Adds basedirs as a comman separated list.
      * @param b boolean cache flag.
      */
-    public void setBaseDirs(String dirs) {
+    public void setBaseDirs(final String dirs) {
         if (isReference()) {
             throw tooManyAttributes();
         }
         if (dirs != null && dirs.length() > 0) {
-            String[] ds = dirs.split(",");
-            for (String d : ds) {
+            final String[] ds = dirs.split(",");
+            for (final String d : ds) {
                 baseDirs.add(getProject().resolveFile(d));
             }
         }
@@ -90,7 +90,7 @@ public class MultiRootFileSet extends AbstractFileSet
     /**
      * Adds a basedir as nested element.
      */
-    public void addConfiguredBaseDir(FileResource r) {
+    public void addConfiguredBaseDir(final FileResource r) {
         if (isReference()) {
             throw noChildrenAllowed();
         }
@@ -98,7 +98,7 @@ public class MultiRootFileSet extends AbstractFileSet
     }
 
     @Override
-	public void setRefid(Reference r) {
+	public void setRefid(final Reference r) {
         if (!baseDirs.isEmpty()) {
             throw tooManyAttributes();
         }
@@ -115,7 +115,7 @@ public class MultiRootFileSet extends AbstractFileSet
         if (isReference()) {
             return ((MultiRootFileSet) getRef(getProject())).clone();
         } else {
-            MultiRootFileSet fs = (MultiRootFileSet) super.clone();
+            final MultiRootFileSet fs = (MultiRootFileSet) super.clone();
             fs.baseDirs = new ArrayList<File>(baseDirs);
             fs.union = null;
             return fs;
@@ -126,7 +126,6 @@ public class MultiRootFileSet extends AbstractFileSet
      * Fulfill the ResourceCollection contract.
      * @return an Iterator of Resources.
      */
-    @Override
 	public Iterator<Resource> iterator() {
         if (isReference()) {
             return ((MultiRootFileSet) getRef(getProject())).iterator();
@@ -138,7 +137,6 @@ public class MultiRootFileSet extends AbstractFileSet
      * Fulfill the ResourceCollection contract.
      * @return number of elements as int.
      */
-    @Override
 	public int size() {
         if (isReference()) {
             return ((MultiRootFileSet) getRef(getProject())).size();
@@ -150,7 +148,6 @@ public class MultiRootFileSet extends AbstractFileSet
      * Always returns true.
      * @return true indicating that all elements will be FileResources.
      */
-    @Override
 	public boolean isFilesystemOnly() {
         return true;
     }
@@ -172,7 +169,7 @@ public class MultiRootFileSet extends AbstractFileSet
         if (cache && union != null) {
             return union;
         }
-        Union u = new Union();
+        final Union u = new Union();
         setup(u);
         if (cache) {
             union = u;
@@ -180,8 +177,8 @@ public class MultiRootFileSet extends AbstractFileSet
         return u;
     }
 
-    private void setup(Union u) {
-        for (File d : baseDirs) {
+    private void setup(final Union u) {
+        for (final File d : baseDirs) {
             u.add(new Worker(this, type, d));
         }
     }
@@ -198,26 +195,24 @@ public class MultiRootFileSet extends AbstractFileSet
 
         private final SetType type;
 
-        private Worker(MultiRootFileSet fs, SetType type, File dir) {
+        private Worker(final MultiRootFileSet fs, final SetType type, final File dir) {
             super(fs);
             this.type = type;
             setDir(dir);
         }
 
-        @Override
 		public boolean isFilesystemOnly() {
             return true;
         }
 
-        @Override
 		public Iterator<Resource> iterator() {
-            DirectoryScanner ds = getDirectoryScanner(getProject());
+            final DirectoryScanner ds = getDirectoryScanner(getProject());
             String[] names = type == SetType.file
                 ? ds.getIncludedFiles()
                 : ds.getIncludedDirectories();
             if (type == SetType.both) {
-                String[] files = ds.getIncludedFiles();
-                String[] merged = new String[names.length + files.length];
+                final String[] files = ds.getIncludedFiles();
+                final String[] merged = new String[names.length + files.length];
                 System.arraycopy(names, 0, merged, 0, names.length);
                 System.arraycopy(files, 0, merged, names.length, files.length);
                 names = merged;
@@ -226,9 +221,8 @@ public class MultiRootFileSet extends AbstractFileSet
                                             names);
         }
 
-        @Override
 		public int size() {
-            DirectoryScanner ds = getDirectoryScanner(getProject());
+            final DirectoryScanner ds = getDirectoryScanner(getProject());
             int count = type == SetType.file
                 ? ds.getIncludedFilesCount()
                 : ds.getIncludedDirsCount();

http://git-wip-us.apache.org/repos/asf/ant/blob/13f6d98c/src/main/org/apache/tools/ant/types/resources/selectors/Type.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/types/resources/selectors/Type.java b/src/main/org/apache/tools/ant/types/resources/selectors/Type.java
index c35c18f..3a07e8d 100644
--- a/src/main/org/apache/tools/ant/types/resources/selectors/Type.java
+++ b/src/main/org/apache/tools/ant/types/resources/selectors/Type.java
@@ -99,7 +99,6 @@ public class Type implements ResourceSelector {
      * @param r the Resource to check.
      * @return whether the Resource was selected.
      */
-    @Override
 	public boolean isSelected(final Resource r) {
         if (type == null) {
             throw new BuildException("The type attribute is required.");

http://git-wip-us.apache.org/repos/asf/ant/blob/13f6d98c/src/main/org/apache/tools/ant/util/ResourceUtils.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/util/ResourceUtils.java b/src/main/org/apache/tools/ant/util/ResourceUtils.java
index 891447c..84f4831 100644
--- a/src/main/org/apache/tools/ant/util/ResourceUtils.java
+++ b/src/main/org/apache/tools/ant/util/ResourceUtils.java
@@ -145,11 +145,9 @@ public class ResourceUtils {
         logFuture(logTo, source, granularity);
         final ResourceSelectorProvider p =
             new ResourceSelectorProvider() {
-                @Override
 				public ResourceSelector
                     getTargetSelectorForSource(final Resource sr) {
                     return new ResourceSelector() {
-                        @Override
 						public boolean isSelected(final Resource target) {
                             /* Extra I/O, probably wasted:
                                if (target.isDirectory()) {