ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [10/17] checkstyle
Date Fri, 04 Jul 2014 07:17:52 GMT
http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Directory.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Directory.java b/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Directory.java
index f545591..3dea1d8 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Directory.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Directory.java
@@ -119,13 +119,12 @@ public class Directory {
      * @return the child directory, or null if not found
      */
     public Directory getChild(File dir) {
-        for (Iterator i = childDirectories.iterator(); i.hasNext(); ) {
+        for (Iterator i = childDirectories.iterator(); i.hasNext();) {
             Directory current = (Directory) i.next();
             if (current.getDirectory().equals(dir)) {
                 return current;
             }
         }
-
         return null;
     }
 
@@ -135,7 +134,8 @@ public class Directory {
      * @param obj the object to compare to
      * @return true if this object has an equal directory field as the other object
      */
-    public boolean equals(Object obj) {
+    @Override
+	public boolean equals(Object obj) {
         if (obj == this) {
             return true;
         }
@@ -153,7 +153,8 @@ public class Directory {
      * The hashcode method.
      * @return the hash code of the directory field
      */
-    public int hashCode() {
+    @Override
+	public int hashCode() {
         return directory.hashCode();
     }
 

http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java b/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java
index 1a8517b..564d07d 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java
@@ -100,7 +100,7 @@ public class SSHExec extends SSHBase {
      *
      * @param command  The new command value
      */
-    public void setCommand(String command) {
+    public void setCommand(final String command) {
         this.command = command;
     }
 
@@ -109,7 +109,7 @@ public class SSHExec extends SSHBase {
      * @param f the value to use.
      * @since Ant 1.7.1
      */
-    public void setCommandResource(String f) {
+    public void setCommandResource(final String f) {
         this.commandResource = new FileResource(new File(f));
     }
 
@@ -120,7 +120,7 @@ public class SSHExec extends SSHBase {
      *
      * @param timeout  The new timeout value in seconds
      */
-    public void setTimeout(long timeout) {
+    public void setTimeout(final long timeout) {
         maxwait = timeout;
     }
 
@@ -129,7 +129,7 @@ public class SSHExec extends SSHBase {
      *
      * @param output  The file to write to.
      */
-    public void setOutput(File output) {
+    public void setOutput(final File output) {
         outputFile = output;
     }
 
@@ -139,7 +139,7 @@ public class SSHExec extends SSHBase {
      * @param output  The file to write to.
      * @since Apache Ant 1.9.4
      */
-    public void setErrorOutput(File output) {
+    public void setErrorOutput(final File output) {
         errorFile = output;
     }
 
@@ -150,7 +150,7 @@ public class SSHExec extends SSHBase {
      *
      * @since Ant 1.8.0
      */
-    public void setInput(File input) {
+    public void setInput(final File input) {
         inputFile = input;
     }
 
@@ -162,7 +162,7 @@ public class SSHExec extends SSHBase {
      *
      * @since Ant 1.8.0
      */
-    public void setInputProperty(String inputProperty) {
+    public void setInputProperty(final String inputProperty) {
         this.inputProperty = inputProperty;
     }
 
@@ -173,7 +173,7 @@ public class SSHExec extends SSHBase {
      *
      * @since Ant 1.8.3
      */
-    public void setInputString(String inputString) {
+    public void setInputString(final String inputString) {
         this.inputString = inputString;
     }
 
@@ -184,7 +184,7 @@ public class SSHExec extends SSHBase {
      *
      * @param append  True to append to an existing file, false to overwrite.
      */
-    public void setAppend(boolean append) {
+    public void setAppend(final boolean append) {
         this.append = append;
     }
 
@@ -196,7 +196,7 @@ public class SSHExec extends SSHBase {
      * @param append  True to append to an existing file, false to overwrite.
      * @since Apache Ant 1.9.4
      */
-    public void setErrAppend(boolean appenderr) {
+    public void setErrAppend(final boolean appenderr) {
         this.appenderr = appenderr;
     }
 
@@ -206,7 +206,7 @@ public class SSHExec extends SSHBase {
      * @param property  The name of the property in which the command output
      *      will be stored.
      */
-    public void setOutputproperty(String property) {
+    public void setOutputproperty(final String property) {
         outputProperty = property;
     }
 
@@ -217,7 +217,7 @@ public class SSHExec extends SSHBase {
      *      will be stored.
      * @since Apache Ant 1.9.4
      */
-    public void setErrorproperty (String property) {
+    public void setErrorproperty (final String property) {
         errorProperty = property;
     }
 
@@ -228,7 +228,7 @@ public class SSHExec extends SSHBase {
      *      will be stored.
      * @since Apache Ant 1.9.4
      */
-    public void setResultproperty(String property) {
+    public void setResultproperty(final String property) {
         resultProperty = property;
     }
 
@@ -236,17 +236,17 @@ public class SSHExec extends SSHBase {
      * Whether a pseudo-tty should be allocated.
      * @since Apache Ant 1.8.3
      */
-    public void setUsePty(boolean b) {
+    public void setUsePty(final boolean b) {
         usePty = b;
     }
 
     /**
      * If set, input will be taken from System.in
-     * 
+     *
      * @param useSystemIn True to use System.in as InputStream, false otherwise
      * @since Apache Ant 1.9.4
      */
-    public void setUseSystemIn(boolean useSystemIn) {
+    public void setUseSystemIn(final boolean useSystemIn) {
         this.useSystemIn = useSystemIn;
     }
 
@@ -255,7 +255,7 @@ public class SSHExec extends SSHBase {
      * If suppressSystemOut is <code>false</code>, normal behavior
      * @since Ant 1.9.0
      */
-    public void setSuppressSystemOut(boolean suppressSystemOut) {
+    public void setSuppressSystemOut(final boolean suppressSystemOut) {
         this.suppressSystemOut = suppressSystemOut;
     }
 
@@ -264,7 +264,7 @@ public class SSHExec extends SSHBase {
      * If suppressSystemErr is <code>false</code>, normal behavior
      * @since Ant 1.9.4
      */
-    public void setSuppressSystemErr(boolean suppressSystemErr) {
+    public void setSuppressSystemErr(final boolean suppressSystemErr) {
         this.suppressSystemErr = suppressSystemErr;
     }
 
@@ -273,7 +273,8 @@ public class SSHExec extends SSHBase {
      *
      * @exception BuildException  Most likely a network error or bad parameter.
      */
-    public void execute() throws BuildException {
+    @Override
+	public void execute() throws BuildException {
 
         if (getHost() == null) {
             throw new BuildException("Host is required.");
@@ -289,7 +290,7 @@ public class SSHExec extends SSHBase {
             throw new BuildException("Command or commandResource is required.");
         }
 
-        int numberOfInputs = (inputFile != null ? 1 : 0)
+        final int numberOfInputs = (inputFile != null ? 1 : 0)
             + (inputProperty != null ? 1 : 0)
             + (inputString != null ? 1 : 0);
         if (numberOfInputs > 1) {
@@ -304,7 +305,7 @@ public class SSHExec extends SSHBase {
         }
 
         Session session = null;
-        StringBuffer output = new StringBuffer();
+        final StringBuffer output = new StringBuffer();
         try {
             session = openSession();
             /* called once */
@@ -313,7 +314,7 @@ public class SSHExec extends SSHBase {
                 executeCommand(session, command, output);
             } else { // read command resource and execute for each command
                 try {
-                    BufferedReader br = new BufferedReader(
+                    final BufferedReader br = new BufferedReader(
                             new InputStreamReader(commandResource.getInputStream()));
                     String cmd;
                     while ((cmd = br.readLine()) != null) {
@@ -323,7 +324,7 @@ public class SSHExec extends SSHBase {
                         output.append("\n");
                     }
                     FileUtils.close(br);
-                } catch (IOException e) {
+                } catch (final IOException e) {
                     if (getFailonerror()) {
                         throw new BuildException(e);
                     } else {
@@ -332,7 +333,7 @@ public class SSHExec extends SSHBase {
                     }
                 }
             }
-        } catch (JSchException e) {
+        } catch (final JSchException e) {
             if (getFailonerror()) {
                 throw new BuildException(e);
             } else {
@@ -348,18 +349,18 @@ public class SSHExec extends SSHBase {
         }
     }
 
-    private void executeCommand(Session session, String cmd, StringBuffer sb)
+    private void executeCommand(final Session session, final String cmd, final StringBuffer sb)
         throws BuildException {
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        ByteArrayOutputStream errout = new ByteArrayOutputStream();
-        OutputStream teeErr = suppressSystemErr ? errout : new TeeOutputStream(errout, KeepAliveOutputStream.wrapSystemErr());
-        OutputStream tee = suppressSystemOut ? out : new TeeOutputStream(out, KeepAliveOutputStream.wrapSystemOut());
+        final ByteArrayOutputStream out = new ByteArrayOutputStream();
+        final ByteArrayOutputStream errout = new ByteArrayOutputStream();
+        final OutputStream teeErr = suppressSystemErr ? errout : new TeeOutputStream(errout, KeepAliveOutputStream.wrapSystemErr());
+        final OutputStream tee = suppressSystemOut ? out : new TeeOutputStream(out, KeepAliveOutputStream.wrapSystemOut());
 
-        InputStream istream = null ;
+        InputStream istream = null;
         if (inputFile != null) {
             try {
-                istream = new FileInputStream(inputFile) ;
-            } catch (IOException e) {
+                istream = new FileInputStream(inputFile);
+            } catch (final IOException e) {
                 // because we checked the existence before, this one
                 // shouldn't happen What if the file exists, but there
                 // are no read permissions?
@@ -368,9 +369,9 @@ public class SSHExec extends SSHBase {
             }
         }
         if (inputProperty != null) {
-            String inputData = getProject().getProperty(inputProperty) ;
+            final String inputData = getProject().getProperty(inputProperty);
             if (inputData != null) {
-                istream = new ByteArrayInputStream(inputData.getBytes()) ;
+                istream = new ByteArrayInputStream(inputData.getBytes());
             }
         }
         if (inputString != null) {
@@ -398,14 +399,15 @@ public class SSHExec extends SSHBase {
             // wait for it to finish
             thread =
                 new Thread() {
-                    public void run() {
+                    @Override
+					public void run() {
                         while (!channel.isClosed()) {
                             if (thread == null) {
                                 return;
                             }
                             try {
                                 sleep(RETRY_INTERVAL);
-                            } catch (Exception e) {
+                            } catch (final Exception e) {
                                 // ignored
                             }
                         }
@@ -438,13 +440,13 @@ public class SSHExec extends SSHBase {
                 }
                 // this is the wrong test if the remote OS is OpenVMS,
                 // but there doesn't seem to be a way to detect it.
-                int ec = channel.getExitStatus();
+                final int ec = channel.getExitStatus();
                 // set resultproperty
                 if (resultProperty != null) {
                     getProject().setNewProperty(resultProperty, Integer.toString(ec));
                 }
                 if (ec != 0) {
-                    String msg = "Remote command failed with exit status " + ec;
+                    final String msg = "Remote command failed with exit status " + ec;
                     if (getFailonerror()) {
                         throw new BuildException(msg);
                     } else {
@@ -452,9 +454,9 @@ public class SSHExec extends SSHBase {
                     }
                 }
             }
-        } catch (BuildException e) {
+        } catch (final BuildException e) {
             throw e;
-        } catch (JSchException e) {
+        } catch (final JSchException e) {
             if (e.getMessage().indexOf("session is down") >= 0) {
                 if (getFailonerror()) {
                     throw new BuildException(TIMEOUT_MESSAGE, e);
@@ -469,7 +471,7 @@ public class SSHExec extends SSHBase {
                         Project.MSG_ERR);
                 }
             }
-        } catch (Exception e) {
+        } catch (final Exception e) {
             if (getFailonerror()) {
                 throw new BuildException(e);
             } else {
@@ -490,13 +492,13 @@ public class SSHExec extends SSHBase {
      * @param append         if true, append to existing file, else overwrite
      * @exception Exception  most likely an IOException
      */
-    private void writeToFile(String from, boolean append, File to)
+    private void writeToFile(final String from, final boolean append, final File to)
         throws IOException {
         FileWriter out = null;
         try {
             out = new FileWriter(to.getAbsolutePath(), append);
-            StringReader in = new StringReader(from);
-            char[] buffer = new char[BUFFER_SIZE];
+            final StringReader in = new StringReader(from);
+            final char[] buffer = new char[BUFFER_SIZE];
             int bytesRead;
             while (true) {
                 bytesRead = in.read(buffer);

http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHSession.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHSession.java b/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHSession.java
index c70813f..b39aa6b 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHSession.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHSession.java
@@ -130,7 +130,8 @@ public class SSHSession extends SSHBase {
      * @exception BuildException if one of the nested tasks fails, or
      * network error or bad parameter.
      */
-    public void execute() throws BuildException {
+    @Override
+	public void execute() throws BuildException {
         if (getHost() == null) {
             throw new BuildException("Host is required.");
         }
@@ -277,13 +278,13 @@ public class SSHSession extends SSHBase {
             return lport;
         }
         public String getLHost() {
-            if (lhost == null) { 
+            if (lhost == null) {
             	throw new BuildException("lhost is required for RemoteTunnel.");
             }
             return lhost;
         }
         public int getRPort() {
-            if (rport == 0) { 
+            if (rport == 0) {
             	throw new BuildException("rport is required for RemoteTunnel.");
             }
             return rport;
@@ -315,7 +316,8 @@ public class SSHSession extends SSHBase {
          *
          * @param task an unknown element.
          */
-        public void addTask(Task task) {
+        @Override
+		public void addTask(Task task) {
             nested.add(task);
         }
 

http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java b/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java
index 62b4245..74cd2c8 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java
@@ -123,7 +123,7 @@ public class Scp extends SSHBase {
      */
     public void setPreservelastmodified(boolean yesOrNo) {
     	this.preserveLastModified = yesOrNo;
-    }    
+    }
 
     /**
      * Similiar to {@link #setTodir setTodir} but explicitly states
@@ -145,7 +145,7 @@ public class Scp extends SSHBase {
                                      + "following: user:password@host:/path"
                                      + " - the :password part is optional");
     	}
-    } 
+    }
 
     /**
      * Changes the file name to the given name while receiving it,
@@ -196,7 +196,8 @@ public class Scp extends SSHBase {
      * Initialize this task.
      * @throws BuildException on error
      */
-    public void init() throws BuildException {
+    @Override
+	public void init() throws BuildException {
         super.init();
         this.toUri = null;
         this.fromUri = null;
@@ -207,7 +208,8 @@ public class Scp extends SSHBase {
      * Execute this task.
      * @throws BuildException on error
      */
-    public void execute() throws BuildException {
+    @Override
+	public void execute() throws BuildException {
         if (toUri == null) {
             throw exactlyOne(TO_ATTRS);
         }
@@ -362,7 +364,7 @@ public class Scp extends SSHBase {
             // no password, will require keyfile
             setUsername(uri.substring(0, indexOfAt));
         } else {
-            throw new BuildException("no username was given.  Can't authenticate."); 
+            throw new BuildException("no username was given.  Can't authenticate.");
         }
 
         if (getUserInfo().getPassword() == null

http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java b/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
index 4369028..cc52059 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
@@ -129,7 +129,8 @@ public class Symlink extends DispatchTask {
      * Initialize the task.
      * @throws BuildException on error.
      */
-    public void init() throws BuildException {
+    @Override
+	public void init() throws BuildException {
         super.init();
         setDefaults();
     }
@@ -138,7 +139,8 @@ public class Symlink extends DispatchTask {
      * The standard method for executing any task.
      * @throws BuildException on error.
      */
-    public synchronized void execute() throws BuildException {
+    @Override
+	public synchronized void execute() throws BuildException {
         if (executing) {
             throw new BuildException(
                 "Infinite recursion detected in Symlink.execute()");
@@ -325,7 +327,8 @@ public class Symlink extends DispatchTask {
      *
      * @param action    The action to perform.
      */
-    public void setAction(String action) {
+    @Override
+	public void setAction(String action) {
         super.setAction(action);
     }
 
@@ -383,7 +386,8 @@ public class Symlink extends DispatchTask {
      * org.apache.tools.ant.util.SymbolicLinkUtils#deleteSymbolicLink
      * instead
      */
-    public static void deleteSymlink(String path)
+    @Deprecated
+	public static void deleteSymlink(String path)
         throws IOException, FileNotFoundException {
         SYMLINK_UTILS.deleteSymbolicLink(new File(path), null);
     }
@@ -403,7 +407,7 @@ public class Symlink extends DispatchTask {
      * an exception.</p>
      *
      * <p>Since Ant 1.8.0 this method will try to delete the File object if
-     * it reports it wouldn't exist (as symlinks pointing nowhere usually do). 
+     * it reports it wouldn't exist (as symlinks pointing nowhere usually do).
      * Prior version would throw a FileNotFoundException in that case.</p>
      *
      * @param linkfil    A <code>File</code> object of the symlink to delete.
@@ -416,7 +420,8 @@ public class Symlink extends DispatchTask {
      * org.apache.tools.ant.util.SymbolicLinkUtils#deleteSymbolicLink
      * instead
      */
-    public static void deleteSymlink(File linkfil)
+    @Deprecated
+	public static void deleteSymlink(File linkfil)
         throws IOException {
         SYMLINK_UTILS.deleteSymbolicLink(linkfil, null);
     }

http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/types/FilterChain.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/types/FilterChain.java b/src/main/org/apache/tools/ant/types/FilterChain.java
index 06e8899..a848ce7 100644
--- a/src/main/org/apache/tools/ant/types/FilterChain.java
+++ b/src/main/org/apache/tools/ant/types/FilterChain.java
@@ -374,7 +374,8 @@ public class FilterChain extends DataType
      * @param r the reference to which this instance is associated
      * @exception BuildException if this instance already has been configured.
      */
-    public void setRefid(Reference r) throws BuildException {
+    @Override
+	public void setRefid(Reference r) throws BuildException {
         if (!filterReaders.isEmpty()) {
             throw tooManyAttributes();
         }
@@ -396,7 +397,8 @@ public class FilterChain extends DataType
         filterReaders.addElement(filter);
     }
 
-    protected synchronized void dieOnCircularReference(Stack<Object> stk, Project p)
+    @Override
+	protected synchronized void dieOnCircularReference(Stack<Object> stk, Project p)
         throws BuildException {
         if (isChecked()) {
             return;
@@ -404,7 +406,7 @@ public class FilterChain extends DataType
         if (isReference()) {
             super.dieOnCircularReference(stk, p);
         } else {
-            for (Iterator<Object> i = filterReaders.iterator(); i.hasNext(); ) {
+            for (Iterator<Object> i = filterReaders.iterator(); i.hasNext();) {
                 Object o = i.next();
                 if (o instanceof DataType) {
                     pushAndInvokeCircularReferenceCheck((DataType) o, stk, p);

http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/types/FilterSet.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/types/FilterSet.java b/src/main/org/apache/tools/ant/types/FilterSet.java
index 761deaa..b853dd1 100644
--- a/src/main/org/apache/tools/ant/types/FilterSet.java
+++ b/src/main/org/apache/tools/ant/types/FilterSet.java
@@ -164,7 +164,8 @@ public class FilterSet extends DataType implements Cloneable {
 
         //inherit doc
         /** {@inheritDoc}. */
-        public String[] getValues() {
+        @Override
+		public String[] getValues() {
             return VALUES;
         }
     }
@@ -229,7 +230,7 @@ public class FilterSet extends DataType implements Cloneable {
             readingFiles = true;
             final int size = filtersFiles.size();
             for (int i = 0; i < size; i++) {
-                readFiltersFromFile((File) filtersFiles.get(i));
+                readFiltersFromFile(filtersFiles.get(i));
             }
             filtersFiles.clear();
             readingFiles = false;
@@ -243,7 +244,7 @@ public class FilterSet extends DataType implements Cloneable {
      * @return the filterset from the reference.
      */
     protected FilterSet getRef() {
-        return (FilterSet) getCheckedRef(FilterSet.class, "filterset");
+        return getCheckedRef(FilterSet.class, "filterset");
     }
 
     /**
@@ -461,7 +462,7 @@ public class FilterSet extends DataType implements Cloneable {
 
     /**
      * Adds the properties provided by the specified PropertySet to this filterset.
-     * 
+     *
      * @param propertySet the propertyset to be added to this propertyset
      */
     public synchronized void addConfiguredPropertySet(PropertySet propertySet) {
@@ -492,9 +493,10 @@ public class FilterSet extends DataType implements Cloneable {
      *
      * @throws BuildException if the clone cannot be performed.
      */
-    public synchronized Object clone() throws BuildException {
+    @Override
+	public synchronized Object clone() throws BuildException {
         if (isReference()) {
-            return ((FilterSet) getRef()).clone();
+            return getRef().clone();
         }
         try {
             FilterSet fs = (FilterSet) super.clone();
@@ -621,7 +623,7 @@ public class FilterSet extends DataType implements Cloneable {
         } else if (duplicateToken) {
             // should always be the case...
             if (passedTokens.size() > 0) {
-                value = (String) passedTokens.remove(passedTokens.size() - 1);
+                value = passedTokens.remove(passedTokens.size() - 1);
                 if (passedTokens.size() == 0) {
                     value = beginToken + value + endToken;
                     duplicateToken = false;

http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/types/Permissions.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/types/Permissions.java b/src/main/org/apache/tools/ant/types/Permissions.java
index 2ee0cf2..1036338 100644
--- a/src/main/org/apache/tools/ant/types/Permissions.java
+++ b/src/main/org/apache/tools/ant/types/Permissions.java
@@ -44,12 +44,12 @@ import org.apache.tools.ant.ExitException;
  */
 public class Permissions {
 
-    private List<Permission> grantedPermissions = new LinkedList<Permission>();
-    private List<Permission> revokedPermissions = new LinkedList<Permission>();
+    private final List<Permission> grantedPermissions = new LinkedList<Permission>();
+    private final List<Permission> revokedPermissions = new LinkedList<Permission>();
     private java.security.Permissions granted = null;
     private SecurityManager origSm = null;
     private boolean active = false;
-    private boolean delegateToOldSM;
+    private final boolean delegateToOldSM;
 
     // Mandatory constructor for permission object.
     private static final Class<?>[] PARAMS = {String.class, String.class};
@@ -68,7 +68,7 @@ public class Permissions {
      * will be used if the permission has not been explicitly granted or revoked
      * in this instance.
      */
-    public Permissions(boolean delegateToOldSM) {
+    public Permissions(final boolean delegateToOldSM) {
         this.delegateToOldSM = delegateToOldSM;
     }
 
@@ -76,7 +76,7 @@ public class Permissions {
      * Adds a permission to be granted.
      * @param perm The Permissions.Permission to be granted.
      */
-    public void addConfiguredGrant(Permissions.Permission perm) {
+    public void addConfiguredGrant(final Permissions.Permission perm) {
         grantedPermissions.add(perm);
     }
 
@@ -84,7 +84,7 @@ public class Permissions {
      * Adds a permission to be revoked.
      * @param perm The Permissions.Permission to be revoked
      */
-    public void addConfiguredRevoke(Permissions.Permission perm) {
+    public void addConfiguredRevoke(final Permissions.Permission perm) {
         revokedPermissions.add(perm);
     }
 
@@ -107,17 +107,17 @@ public class Permissions {
      */
     private void init() throws BuildException {
         granted = new java.security.Permissions();
-        for (Permissions.Permission p : revokedPermissions) {
+        for (final Permissions.Permission p : revokedPermissions) {
             if (p.getClassName() == null) {
                 throw new BuildException("Revoked permission " + p + " does not contain a class.");
             }
         }
-        for (Permissions.Permission p : grantedPermissions) {
+        for (final Permissions.Permission p : grantedPermissions) {
             if (p.getClassName() == null) {
                 throw new BuildException("Granted permission " + p
                         + " does not contain a class.");
             } else {
-                java.security.Permission perm = createPermission(p);
+                final java.security.Permission perm = createPermission(p);
                 granted.add(perm);
             }
         }
@@ -146,17 +146,17 @@ public class Permissions {
     }
 
     private java.security.Permission createPermission(
-            Permissions.Permission permission) {
+            final Permissions.Permission permission) {
         try {
             // First add explicitly already resolved permissions will not be
             // resolved when added as unresolved permission.
-            Class<? extends java.security.Permission> clazz = Class.forName(
+            final Class<? extends java.security.Permission> clazz = Class.forName(
                     permission.getClassName()).asSubclass(java.security.Permission.class);
-            String name = permission.getName();
-            String actions = permission.getActions();
-            Constructor<? extends java.security.Permission> ctr = clazz.getConstructor(PARAMS);
-            return ctr.newInstance(new Object[] { name, actions });
-        } catch (Exception e) {
+            final String name = permission.getName();
+            final String actions = permission.getActions();
+            final Constructor<? extends java.security.Permission> ctr = clazz.getConstructor(PARAMS);
+            return ctr.newInstance(new Object[] {name, actions});
+        } catch (final Exception e) {
             // Let the UnresolvedPermission handle it.
             return new UnresolvedPermission(permission.getClassName(),
                     permission.getName(), permission.getActions(), null);
@@ -185,11 +185,12 @@ public class Permissions {
          * Overridden from java.lang.SecurityManager
          * @param status The exit status requested.
          */
-        public void checkExit(int status) {
-            java.security.Permission perm = new java.lang.RuntimePermission("exitVM", null);
+        @Override
+		public void checkExit(final int status) {
+            final java.security.Permission perm = new java.lang.RuntimePermission("exitVM", null);
             try {
                 checkPermission(perm);
-            } catch (SecurityException e) {
+            } catch (final SecurityException e) {
                 throw new ExitException(e.getMessage(), status);
             }
         }
@@ -200,7 +201,8 @@ public class Permissions {
          *
          * @param perm The permission requested.
          */
-        public void checkPermission(java.security.Permission perm) {
+        @Override
+		public void checkPermission(final java.security.Permission perm) {
             if (active) {
                 if (delegateToOldSM && !perm.getName().equals("exitVM")) {
                     boolean permOK = false;
@@ -228,8 +230,8 @@ public class Permissions {
          * throws an exception if this permission is revoked
          * @param perm the permission being checked
          */
-        private void checkRevoked(java.security.Permission perm) {
-            for (Permissions.Permission revoked : revokedPermissions) {
+        private void checkRevoked(final java.security.Permission perm) {
+            for (final Permissions.Permission revoked : revokedPermissions) {
                 if (revoked.matches(perm)) {
                     throw new SecurityException("Permission " + perm + " was revoked.");
                 }
@@ -248,7 +250,7 @@ public class Permissions {
          * Set the class, mandatory.
          * @param aClass The class name of the permission.
          */
-        public void setClass(String aClass) {
+        public void setClass(final String aClass) {
             className = aClass.trim();
         }
 
@@ -264,7 +266,7 @@ public class Permissions {
          * Set the name of the permission.
          * @param aName The name of the permission.
          */
-        public void setName(String aName) {
+        public void setName(final String aName) {
             name = aName.trim();
         }
 
@@ -280,7 +282,7 @@ public class Permissions {
          * Set the actions.
          * @param actions The actions of the permission.
          */
-        public void setActions(String actions) {
+        public void setActions(final String actions) {
             actionString = actions;
             if (actions.length() > 0) {
                 this.actions = parseActions(actions);
@@ -299,7 +301,7 @@ public class Permissions {
          * Learn whether the permission matches in case of a revoked permission.
          * @param perm The permission to check against.
          */
-        boolean matches(java.security.Permission perm) {
+        boolean matches(final java.security.Permission perm) {
             if (!className.equals(perm.getClass().getName())) {
                 return false;
             }
@@ -315,8 +317,8 @@ public class Permissions {
                 }
             }
             if (actions != null) {
-                Set<String> as = parseActions(perm.getActions());
-                int size = as.size();
+                final Set<String> as = parseActions(perm.getActions());
+                final int size = as.size();
                 as.removeAll(actions);
                 if (as.size() == size) {
                     // None of the actions revoked, so all allowed.
@@ -330,11 +332,11 @@ public class Permissions {
          * Parses the actions into a set of separate strings.
          * @param actions The actions to be parsed.
          */
-        private Set<String> parseActions(String actions) {
-            Set<String> result = new HashSet<String>();
-            StringTokenizer tk = new StringTokenizer(actions, ",");
+        private Set<String> parseActions(final String actions) {
+            final Set<String> result = new HashSet<String>();
+            final StringTokenizer tk = new StringTokenizer(actions, ",");
             while (tk.hasMoreTokens()) {
-                String item = tk.nextToken().trim();
+                final String item = tk.nextToken().trim();
                 if (!item.equals("")) {
                     result.add(item);
                 }
@@ -346,7 +348,8 @@ public class Permissions {
          * Get a string description of the permissions.
          * @return string description of the permissions.
          */
-        public String toString() {
+        @Override
+		public String toString() {
             return ("Permission: " + className + " (\"" + name + "\", \"" + actions + "\")");
         }
     }

http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/types/ResourceCollection.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/types/ResourceCollection.java b/src/main/org/apache/tools/ant/types/ResourceCollection.java
index 85a5e43..0101d70 100644
--- a/src/main/org/apache/tools/ant/types/ResourceCollection.java
+++ b/src/main/org/apache/tools/ant/types/ResourceCollection.java
@@ -19,8 +19,6 @@ package org.apache.tools.ant.types;
 
 import java.util.Iterator;
 
-import org.apache.tools.ant.types.resources.FileProvider;
-
 /**
  * Interface describing a collection of Resources.
  * @since Ant 1.7

http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/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 e1ab5fa..3c2fcbf 100644
--- a/src/main/org/apache/tools/ant/types/mappers/CutDirsMapper.java
+++ b/src/main/org/apache/tools/ant/types/mappers/CutDirsMapper.java
@@ -38,7 +38,7 @@ public class CutDirsMapper implements FileNameMapper {
     /**
      * The number of leading directories to cut.
      */
-    public void setDirs(int dirs) {
+    public void setDirs(final int dirs) {
         this.dirs =  dirs;
     }
 
@@ -46,23 +46,26 @@ public class CutDirsMapper implements FileNameMapper {
      * Empty implementation.
      * @param ignore ignored.
      */
-    public void setFrom(String ignore) {
+    @Override
+	public void setFrom(final String ignore) {
     }
 
     /**
      * Empty implementation.
      * @param ignore ignored.
      */
-    public void setTo(String ignore) {
+    @Override
+	public void setTo(final String ignore) {
     }
 
     /** {@inheritDoc}. */
-    public String[] mapFileName(final String sourceFileName) {
+    @Override
+	public String[] mapFileName(final String sourceFileName) {
         if (dirs <= 0) {
             throw new BuildException("dirs must be set to a positive number");
         }
-        char fileSep = File.separatorChar;
-        String fileSepCorrected =
+        final char fileSep = File.separatorChar;
+        final String fileSepCorrected =
             sourceFileName.replace('/', fileSep).replace('\\', fileSep);
         int nthMatch = fileSepCorrected.indexOf(fileSep);
         for (int n = 1; nthMatch > -1 && n < dirs; n++) {
@@ -71,6 +74,6 @@ public class CutDirsMapper implements FileNameMapper {
         if (nthMatch == -1) {
             return null;
         }
-        return new String[] { sourceFileName.substring(nthMatch + 1) };
+        return new String[] {sourceFileName.substring(nthMatch + 1)};
     }
 }

http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/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 0f45437..943cfd1 100644
--- a/src/main/org/apache/tools/ant/types/resources/Archives.java
+++ b/src/main/org/apache/tools/ant/types/resources/Archives.java
@@ -72,13 +72,14 @@ public class Archives extends DataType
     /**
      * Sums the sizes of nested archives.
      */
-    public int size() {
+    @Override
+	public int size() {
         if (isReference()) {
             return ((Archives) getCheckedRef()).size();
         }
         dieOnCircularReference();
         int total = 0;
-        for (Iterator<ArchiveFileSet> i = grabArchives(); i.hasNext(); ) {
+        for (Iterator<ArchiveFileSet> i = grabArchives(); i.hasNext();) {
             total += i.next().size();
         }
         return total;
@@ -87,13 +88,14 @@ public class Archives extends DataType
     /**
      * Merges the nested collections.
      */
-    public Iterator<Resource> iterator() {
+    @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(); ) {
+        for (Iterator<ArchiveFileSet> i = grabArchives(); i.hasNext();) {
             l.addAll(CollectionUtils
                      .asCollection(i.next().iterator()));
         }
@@ -103,7 +105,8 @@ public class Archives extends DataType
     /**
      * @return false
      */
-    public boolean isFilesystemOnly() {
+    @Override
+	public boolean isFilesystemOnly() {
         if (isReference()) {
             return ((Archives) getCheckedRef()).isFilesystemOnly();
         }
@@ -115,7 +118,8 @@ public class Archives extends DataType
      * Overrides the base version.
      * @param r the Reference to set.
      */
-    public void setRefid(Reference r) {
+    @Override
+	public void setRefid(Reference r) {
         if (zips.getResourceCollections().size() > 0
             || tars.getResourceCollections().size() > 0) {
             throw tooManyAttributes();
@@ -128,7 +132,8 @@ public class Archives extends DataType
      * well.
      * @return a cloned instance.
      */
-    public Object clone() {
+    @Override
+	public Object clone() {
         try {
             Archives a = (Archives) super.clone();
             a.zips = (Union) zips.clone();
@@ -174,7 +179,8 @@ public class Archives extends DataType
      * @param p   the project to use to dereference the references.
      * @throws BuildException on error.
      */
-    protected synchronized void dieOnCircularReference(Stack<Object> stk, Project p)
+    @Override
+	protected synchronized void dieOnCircularReference(Stack<Object> stk, Project p)
         throws BuildException {
         if (isChecked()) {
             return;

http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/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 4921e34..b4d6de0 100644
--- a/src/main/org/apache/tools/ant/types/resources/ContentTransformingResource.java
+++ b/src/main/org/apache/tools/ant/types/resources/ContentTransformingResource.java
@@ -55,7 +55,8 @@ public abstract class ContentTransformingResource extends ResourceDecorator {
      * @return the size, as a long, 0 if the Resource does not exist (for
      *         compatibility with java.io.File), or UNKNOWN_SIZE if not known.
      */
-    public long getSize() {
+    @Override
+	public long getSize() {
         if (isExists()) {
             InputStream in = null;
             try {
@@ -86,7 +87,8 @@ public abstract class ContentTransformingResource extends ResourceDecorator {
      * @throws UnsupportedOperationException if InputStreams are not
      *         supported for this Resource type.
      */
-    public InputStream getInputStream() throws IOException {
+    @Override
+	public InputStream getInputStream() throws IOException {
         InputStream in = getResource().getInputStream();
         if (in != null) {
             in = wrapStream(in);
@@ -102,7 +104,8 @@ public abstract class ContentTransformingResource extends ResourceDecorator {
      * @throws UnsupportedOperationException if OutputStreams are not
      *         supported for this Resource type.
      */
-    public OutputStream getOutputStream() throws IOException {
+    @Override
+	public OutputStream getOutputStream() throws IOException {
         OutputStream out = getResource().getOutputStream();
         if (out != null) {
             out = wrapStream(out);
@@ -113,14 +116,16 @@ public abstract class ContentTransformingResource extends ResourceDecorator {
     /**
      * Suppress FileProvider, re-implement Appendable
      */
-    public <T> T as(Class<T> clazz) {
+    @Override
+	public <T> T as(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() {
-                        public OutputStream getAppendOutputStream()
+                        @Override
+						public OutputStream getAppendOutputStream()
                                 throws IOException {
                             OutputStream out = a.getAppendOutputStream();
                             if (out != null) {
@@ -134,7 +139,7 @@ public abstract class ContentTransformingResource extends ResourceDecorator {
             return null;
         }
 
-        return FileProvider.class.isAssignableFrom(clazz) 
+        return FileProvider.class.isAssignableFrom(clazz)
             ? null : getResource().as(clazz);
     }
 
@@ -148,7 +153,7 @@ public abstract class ContentTransformingResource extends ResourceDecorator {
      */
     protected boolean isAppendSupported() {
         return false;
-    }    
+    }
 
     /**
      * Get a content-filtering/transforming InputStream.

http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/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 a66098d..4bb72b9 100644
--- a/src/main/org/apache/tools/ant/types/resources/LazyResourceCollectionWrapper.java
+++ b/src/main/org/apache/tools/ant/types/resources/LazyResourceCollectionWrapper.java
@@ -36,7 +36,8 @@ public class LazyResourceCollectionWrapper extends
 
     private FilteringIterator filteringIterator;
 
-    protected Iterator<Resource> createIterator() {
+    @Override
+	protected Iterator<Resource> createIterator() {
         Iterator<Resource> iterator;
         if (isCache()) {
             if (filteringIterator == null) {
@@ -51,7 +52,8 @@ public class LazyResourceCollectionWrapper extends
         return iterator;
     }
 
-    protected int getSize() {
+    @Override
+	protected int getSize() {
         // to compute the size, just iterate: the iterator will take care of
         // caching
         Iterator<Resource> it = createIterator();
@@ -66,7 +68,7 @@ public class LazyResourceCollectionWrapper extends
     /**
      * Specify if the resource should be filtered or not. This function should
      * be overrided in order to define the filtering algorithm
-     * 
+     *
      * @param r resource considered for filtration
      * @return whether the resource should be filtered or not
      */
@@ -86,7 +88,8 @@ public class LazyResourceCollectionWrapper extends
             this.it = it;
         }
 
-        public boolean hasNext() {
+        @Override
+		public boolean hasNext() {
             if (ended) {
                 return false;
             }
@@ -103,7 +106,8 @@ public class LazyResourceCollectionWrapper extends
             return true;
         }
 
-        public Resource next() {
+        @Override
+		public Resource next() {
             if (!hasNext()) {
                 throw new UnsupportedOperationException();
             }
@@ -112,7 +116,8 @@ public class LazyResourceCollectionWrapper extends
             return r;
         }
 
-        public void remove() {
+        @Override
+		public void remove() {
             throw new UnsupportedOperationException();
         }
     }
@@ -129,7 +134,7 @@ public class LazyResourceCollectionWrapper extends
 
         /**
          * Default constructor
-         * 
+         *
          * @param it
          *            the iterator which will provide the resources to put in
          *            cache
@@ -138,7 +143,8 @@ public class LazyResourceCollectionWrapper extends
             this.it = it;
         }
 
-        public boolean hasNext() {
+        @Override
+		public boolean hasNext() {
             synchronized (cachedResources) {
                 // have we already cached the next entry ?
                 if (cachedResources.size() > cusrsor) {
@@ -155,7 +161,8 @@ public class LazyResourceCollectionWrapper extends
             return true;
         }
 
-        public Resource next() {
+        @Override
+		public Resource next() {
             // first check that we have some to deliver
             if (!hasNext()) {
                 throw new NoSuchElementException();
@@ -167,7 +174,8 @@ public class LazyResourceCollectionWrapper extends
             }
         }
 
-        public void remove() {
+        @Override
+		public void remove() {
             throw new UnsupportedOperationException();
         }
     }

http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/types/resources/MappedResource.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/types/resources/MappedResource.java b/src/main/org/apache/tools/ant/types/resources/MappedResource.java
index bffc9a8..8b193c4 100644
--- a/src/main/org/apache/tools/ant/types/resources/MappedResource.java
+++ b/src/main/org/apache/tools/ant/types/resources/MappedResource.java
@@ -46,7 +46,8 @@ public class MappedResource extends ResourceDecorator {
     /**
      * Maps the name.
      */
-    public String getName() {
+    @Override
+	public String getName() {
         String name = getResource().getName();
         if (isReference()) {
             return name;
@@ -59,7 +60,8 @@ public class MappedResource extends ResourceDecorator {
      * Not really supported since mapper is never null.
      * @param r reference to set
      */
-    public void setRefid(Reference r) {
+    @Override
+	public void setRefid(Reference r) {
         if (mapper != null) {
             throw noChildrenAllowed();
         }
@@ -70,8 +72,9 @@ public class MappedResource extends ResourceDecorator {
      * Suppress FileProvider
      * @param clazz the type to implement
      */
-    public <T> T as(Class<T> clazz) {
-        return FileProvider.class.isAssignableFrom(clazz) 
+    @Override
+	public <T> T as(Class<T> clazz) {
+        return FileProvider.class.isAssignableFrom(clazz)
                 ? null : getResource().as(clazz);
     }
 
@@ -79,7 +82,8 @@ public class MappedResource extends ResourceDecorator {
      * Get the hash code for this Resource.
      * @since Ant 1.8.1
      */
-    public int hashCode() {
+    @Override
+	public int hashCode() {
         String n = getName();
         return n == null ? super.hashCode() : n.hashCode();
     }
@@ -89,7 +93,8 @@ public class MappedResource extends ResourceDecorator {
      * resource itself.
      * @since Ant 1.8.1
      */
-    public boolean equals(Object other) {
+    @Override
+	public boolean equals(Object other) {
         if (other == null || !other.getClass().equals(getClass())) {
             return false;
         }
@@ -100,7 +105,8 @@ public class MappedResource extends ResourceDecorator {
             && getResource().equals(m.getResource());
     }
 
-    public String toString() {
+    @Override
+	public String toString() {
         if (isReference()) {
             return getCheckedRef().toString();
         }

http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/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 21349bc..8c02578 100644
--- a/src/main/org/apache/tools/ant/types/resources/MultiRootFileSet.java
+++ b/src/main/org/apache/tools/ant/types/resources/MultiRootFileSet.java
@@ -43,7 +43,8 @@ public class MultiRootFileSet extends AbstractFileSet
     private List<File> baseDirs = new ArrayList<File>();
     private Union union;
 
-    public void setDir(File dir) {
+    @Override
+	public void setDir(File dir) {
         throw new BuildException(getDataTypeName()
                                  + " doesn't support the dir attribute");
     }
@@ -96,7 +97,8 @@ public class MultiRootFileSet extends AbstractFileSet
         baseDirs.add(r.getFile());
     }
 
-    public void setRefid(Reference r) {
+    @Override
+	public void setRefid(Reference r) {
         if (!baseDirs.isEmpty()) {
             throw tooManyAttributes();
         }
@@ -108,7 +110,8 @@ public class MultiRootFileSet extends AbstractFileSet
      * as this one.
      * @return the cloned MultiRootFileSet.
      */
-    public Object clone() {
+    @Override
+	public Object clone() {
         if (isReference()) {
             return ((MultiRootFileSet) getRef(getProject())).clone();
         } else {
@@ -123,7 +126,8 @@ public class MultiRootFileSet extends AbstractFileSet
      * Fulfill the ResourceCollection contract.
      * @return an Iterator of Resources.
      */
-    public Iterator<Resource> iterator() {
+    @Override
+	public Iterator<Resource> iterator() {
         if (isReference()) {
             return ((MultiRootFileSet) getRef(getProject())).iterator();
         }
@@ -134,7 +138,8 @@ public class MultiRootFileSet extends AbstractFileSet
      * Fulfill the ResourceCollection contract.
      * @return number of elements as int.
      */
-    public int size() {
+    @Override
+	public int size() {
         if (isReference()) {
             return ((MultiRootFileSet) getRef(getProject())).size();
         }
@@ -145,7 +150,8 @@ public class MultiRootFileSet extends AbstractFileSet
      * Always returns true.
      * @return true indicating that all elements will be FileResources.
      */
-    public boolean isFilesystemOnly() {
+    @Override
+	public boolean isFilesystemOnly() {
         return true;
     }
 
@@ -154,7 +160,8 @@ public class MultiRootFileSet extends AbstractFileSet
      *
      * @return a <code>String</code> of included directories.
      */
-    public String toString() {
+    @Override
+	public String toString() {
         if (isReference()) {
             return ((MultiRootFileSet) getRef(getProject())).toString();
         }
@@ -190,18 +197,20 @@ public class MultiRootFileSet extends AbstractFileSet
         implements ResourceCollection {
 
         private final SetType type;
-        
+
         private Worker(MultiRootFileSet fs, SetType type, File dir) {
             super(fs);
             this.type = type;
             setDir(dir);
         }
 
-        public boolean isFilesystemOnly() {
+        @Override
+		public boolean isFilesystemOnly() {
             return true;
         }
 
-        public Iterator<Resource> iterator() {
+        @Override
+		public Iterator<Resource> iterator() {
             DirectoryScanner ds = getDirectoryScanner(getProject());
             String[] names = type == SetType.file
                 ? ds.getIncludedFiles()
@@ -217,7 +226,8 @@ public class MultiRootFileSet extends AbstractFileSet
                                             names);
         }
 
-        public int size() {
+        @Override
+		public int size() {
             DirectoryScanner ds = getDirectoryScanner(getProject());
             int count = type == SetType.file
                 ? ds.getIncludedFilesCount()

http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/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 6c8cd7a..c35c18f 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
@@ -44,7 +44,7 @@ public class Type implements ResourceSelector {
      * Implements the type attribute.
      */
     public static class FileDir extends EnumeratedAttribute {
-        private static final String[] VALUES = new String[] { FILE_ATTR, DIR_ATTR, ANY_ATTR };
+        private static final String[] VALUES = new String[] {FILE_ATTR, DIR_ATTR, ANY_ATTR};
 
         /**
          * Default constructor.
@@ -56,7 +56,7 @@ public class Type implements ResourceSelector {
          * Convenience constructor.
          * @param value the String EnumeratedAttribute value.
          */
-        public FileDir(String value) {
+        public FileDir(final String value) {
             setValue(value);
         }
 
@@ -64,7 +64,8 @@ public class Type implements ResourceSelector {
          * Return the possible values.
          * @return a String array.
          */
-        public String[] getValues() {
+        @Override
+		public String[] getValues() {
             return VALUES;
         }
     }
@@ -81,7 +82,7 @@ public class Type implements ResourceSelector {
      * Convenience constructor.
      * @param fd the FileDir type.
      */
-    public Type(FileDir fd) {
+    public Type(final FileDir fd) {
         setType(fd);
     }
 
@@ -89,7 +90,7 @@ public class Type implements ResourceSelector {
      * Set type; file|dir.
      * @param fd a FileDir object.
      */
-    public void setType(FileDir fd) {
+    public void setType(final FileDir fd) {
         type = fd;
     }
 
@@ -98,11 +99,12 @@ public class Type implements ResourceSelector {
      * @param r the Resource to check.
      * @return whether the Resource was selected.
      */
-    public boolean isSelected(Resource r) {
+    @Override
+	public boolean isSelected(final Resource r) {
         if (type == null) {
             throw new BuildException("The type attribute is required.");
         }
-        int i = type.getIndex();
+        final int i = type.getIndex();
         return i == 2 || (r.isDirectory() ? i == 1 : i == 0);
     }
 

http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/types/selectors/MappingSelector.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/types/selectors/MappingSelector.java b/src/main/org/apache/tools/ant/types/selectors/MappingSelector.java
index 63e7a44..85e478c 100644
--- a/src/main/org/apache/tools/ant/types/selectors/MappingSelector.java
+++ b/src/main/org/apache/tools/ant/types/selectors/MappingSelector.java
@@ -88,12 +88,13 @@ public abstract class MappingSelector extends BaseSelector {
         }
         this.map = fileNameMapper;
     }
- 
+
     /**
      * Checks to make sure all settings are kosher. In this case, it
      * means that the dest attribute has been set and we have a mapper.
      */
-    public void verifySettings() {
+    @Override
+	public void verifySettings() {
         if (targetdir == null) {
             setError("The targetdir attribute is required.");
         }
@@ -118,7 +119,8 @@ public abstract class MappingSelector extends BaseSelector {
      * @param file is a java.io.File object the selector can use
      * @return whether the file should be selected or not
      */
-    public boolean isSelected(File basedir, String filename, File file) {
+    @Override
+	public boolean isSelected(File basedir, String filename, File file) {
 
         // throw BuildException on error
         validate();

http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/types/selectors/PresentSelector.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/types/selectors/PresentSelector.java b/src/main/org/apache/tools/ant/types/selectors/PresentSelector.java
index f9efce3..9887dca 100644
--- a/src/main/org/apache/tools/ant/types/selectors/PresentSelector.java
+++ b/src/main/org/apache/tools/ant/types/selectors/PresentSelector.java
@@ -51,8 +51,9 @@ public class PresentSelector extends BaseSelector {
     /**
      * @return a string describing this object
      */
-    public String toString() {
-        StringBuilder buf = new StringBuilder("{presentselector targetdir: ");
+    @Override
+	public String toString() {
+        final StringBuilder buf = new StringBuilder("{presentselector targetdir: ");
         if (targetdir == null) {
             buf.append("NOT YET SET");
         } else {
@@ -79,7 +80,7 @@ public class PresentSelector extends BaseSelector {
      *
      * @param targetdir the directory to scan looking for matching files.
      */
-    public void setTargetdir(File targetdir) {
+    public void setTargetdir(final File targetdir) {
         this.targetdir = targetdir;
     }
 
@@ -102,7 +103,7 @@ public class PresentSelector extends BaseSelector {
      * @throws BuildException if more than one mapper defined
      * @since Ant 1.8.0
      */
-    public void addConfigured(FileNameMapper fileNameMapper) {
+    public void addConfigured(final FileNameMapper fileNameMapper) {
         if (map != null || mapperElement != null) {
             throw new BuildException("Cannot define more than one mapper");
         }
@@ -121,7 +122,7 @@ public class PresentSelector extends BaseSelector {
      * @param fp An attribute set to either <code>srconly</code or
      *           <code>both</code>.
      */
-    public void setPresent(FilePresence fp) {
+    public void setPresent(final FilePresence fp) {
         if (fp.getIndex() == 0) {
             destmustexist = false;
         }
@@ -131,7 +132,8 @@ public class PresentSelector extends BaseSelector {
      * Checks to make sure all settings are kosher. In this case, it
      * means that the targetdir attribute has been set and we have a mapper.
      */
-    public void verifySettings() {
+    @Override
+	public void verifySettings() {
         if (targetdir == null) {
             setError("The targetdir attribute is required.");
         }
@@ -156,13 +158,14 @@ public class PresentSelector extends BaseSelector {
      * @param file is a java.io.File object the selector can use
      * @return whether the file should be selected or not
      */
-    public boolean isSelected(File basedir, String filename, File file) {
+    @Override
+	public boolean isSelected(final File basedir, final String filename, final File file) {
 
         // throw BuildException on error
         validate();
 
         // Determine file whose existence is to be checked
-        String[] destfiles = map.mapFileName(filename);
+        final String[] destfiles = map.mapFileName(filename);
         // If filename does not match the To attribute of the mapper
         // then filter it out of the files we are considering
         if (destfiles == null) {
@@ -173,8 +176,8 @@ public class PresentSelector extends BaseSelector {
             throw new BuildException("Invalid destination file results for "
                     + targetdir + " with filename " + filename);
         }
-        String destname = destfiles[0];
-        File destfile = FileUtils.getFileUtils().resolveFile(targetdir, destname);
+        final String destname = destfiles[0];
+        final File destfile = FileUtils.getFileUtils().resolveFile(targetdir, destname);
         return destfile.exists() == destmustexist;
     }
 
@@ -186,8 +189,9 @@ public class PresentSelector extends BaseSelector {
         /**
          * @return the values as an array of strings
          */
-        public String[] getValues() {
-            return new String[] { "srconly", "both" };
+        @Override
+		public String[] getValues() {
+            return new String[] {"srconly", "both"};
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/types/selectors/TokenizedPath.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/types/selectors/TokenizedPath.java b/src/main/org/apache/tools/ant/types/selectors/TokenizedPath.java
index db70d0c..cdc3790 100644
--- a/src/main/org/apache/tools/ant/types/selectors/TokenizedPath.java
+++ b/src/main/org/apache/tools/ant/types/selectors/TokenizedPath.java
@@ -50,14 +50,14 @@ public class TokenizedPath {
     private final String[] tokenizedPath;
 
     /**
-    * Initialize the TokenizedPath by parsing it. 
+    * Initialize the TokenizedPath by parsing it.
     * @param path The path to tokenize. Must not be
     *                <code>null</code>.
     */
     public TokenizedPath(String path) {
         this(path, SelectorUtils.tokenizePathAsArray(path));
     }
-    
+
     /**
      * Creates a new path as a child of another path.
      *
@@ -86,10 +86,11 @@ public class TokenizedPath {
     /**
      * @return The original path String
      */
-    public String toString() {
+    @Override
+	public String toString() {
         return path;
     }
-    
+
     /**
      * The depth (or length) of a path.
      */
@@ -160,12 +161,14 @@ public class TokenizedPath {
     /**
      * true if the original paths are equal.
      */
-    public boolean equals(Object o) {
+    @Override
+	public boolean equals(Object o) {
         return o instanceof TokenizedPath
             && path.equals(((TokenizedPath) o).path);
     }
 
-    public int hashCode() {
+    @Override
+	public int hashCode() {
         return path.hashCode();
     }
 
@@ -213,7 +216,7 @@ public class TokenizedPath {
      * this path.
      */
     public TokenizedPattern toPattern() {
-        return new TokenizedPattern(path, tokenizedPath); 
+        return new TokenizedPattern(path, tokenizedPath);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/util/DOMElementWriter.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/util/DOMElementWriter.java b/src/main/org/apache/tools/ant/util/DOMElementWriter.java
index ea1f7f3..14cbaee 100644
--- a/src/main/org/apache/tools/ant/util/DOMElementWriter.java
+++ b/src/main/org/apache/tools/ant/util/DOMElementWriter.java
@@ -521,7 +521,7 @@ public class DOMElementWriter {
         while (prevEnd < len) {
             final int end = (cdataEndPos < 0 ? len : cdataEndPos);
             // Write out stretches of legal characters in the range [prevEnd, end).
-            for (int prevLegalCharPos = prevEnd; prevLegalCharPos < end; /*empty*/) {
+            for (int prevLegalCharPos = prevEnd; prevLegalCharPos < end;/*empty*/) {
                 int illegalCharPos;
                 for (illegalCharPos = prevLegalCharPos; true; ++illegalCharPos) {
                     if (illegalCharPos >= end

http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/util/JavaEnvUtils.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/util/JavaEnvUtils.java b/src/main/org/apache/tools/ant/util/JavaEnvUtils.java
index 9da26e0..9ed62c3 100644
--- a/src/main/org/apache/tools/ant/util/JavaEnvUtils.java
+++ b/src/main/org/apache/tools/ant/util/JavaEnvUtils.java
@@ -211,7 +211,7 @@ public final class JavaEnvUtils {
      * Searching for changes (grep -r -i -n "@since 1.9" .) in the sources gave
      * only one hit: a new constant in the class SourceVersion.
      * So we have to check that ...
-     * 
+     *
      * @throws Exception if we can't load the class or don't find the new constant.
      *    This is the behavior when searching for new features on older versions.
      * @since Ant 1.9.4

http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/util/LayoutPreservingProperties.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/util/LayoutPreservingProperties.java b/src/main/org/apache/tools/ant/util/LayoutPreservingProperties.java
index bdfcb40..9308292 100644
--- a/src/main/org/apache/tools/ant/util/LayoutPreservingProperties.java
+++ b/src/main/org/apache/tools/ant/util/LayoutPreservingProperties.java
@@ -109,7 +109,7 @@ public class LayoutPreservingProperties extends Properties {
      * Create a new, empty, Properties collection, with the specified defaults.
      * @param defaults the default property values
      */
-    public LayoutPreservingProperties(Properties defaults) {
+    public LayoutPreservingProperties(final Properties defaults) {
         super(defaults);
     }
 
@@ -134,27 +134,30 @@ public class LayoutPreservingProperties extends Properties {
      * removed when a property is removed; <code>false</code>
      * otherwise
      */
-    public void setRemoveComments(boolean val) {
+    public void setRemoveComments(final boolean val) {
         removeComments = val;
     }
 
-    public void load(InputStream inStream) throws IOException {
-        String s = readLines(inStream);
-        byte[] ba = s.getBytes(ResourceUtils.ISO_8859_1);
-        ByteArrayInputStream bais = new ByteArrayInputStream(ba);
+    @Override
+	public void load(final InputStream inStream) throws IOException {
+        final String s = readLines(inStream);
+        final byte[] ba = s.getBytes(ResourceUtils.ISO_8859_1);
+        final ByteArrayInputStream bais = new ByteArrayInputStream(ba);
         super.load(bais);
     }
 
-    public Object put(Object key, Object value) throws NullPointerException {
-        Object obj = super.put(key, value);
+    @Override
+	public Object put(final Object key, final Object value) throws NullPointerException {
+        final Object obj = super.put(key, value);
         // the above call will have failed if key or value are null
         innerSetProperty(key.toString(), value.toString());
         return obj;
     }
 
-    public Object setProperty(String key, String value)
+    @Override
+	public Object setProperty(final String key, final String value)
         throws NullPointerException {
-        Object obj = super.setProperty(key, value);
+        final Object obj = super.setProperty(key, value);
         // the above call will have failed if key or value are null
         innerSetProperty(key, value);
         return obj;
@@ -172,27 +175,29 @@ public class LayoutPreservingProperties extends Properties {
         value = escapeValue(value);
 
         if (keyedPairLines.containsKey(key)) {
-            Integer i = (Integer) keyedPairLines.get(key);
-            Pair p = (Pair) logicalLines.get(i.intValue());
+            final Integer i = (Integer) keyedPairLines.get(key);
+            final Pair p = (Pair) logicalLines.get(i.intValue());
             p.setValue(value);
         } else {
             key = escapeName(key);
-            Pair p = new Pair(key, value);
+            final Pair p = new Pair(key, value);
             p.setNew(true);
             keyedPairLines.put(key, new Integer(logicalLines.size()));
             logicalLines.add(p);
         }
     }
 
-    public void clear() {
+    @Override
+	public void clear() {
         super.clear();
         keyedPairLines.clear();
         logicalLines.clear();
     }
 
-    public Object remove(Object key) {
-        Object obj = super.remove(key);
-        Integer i = (Integer) keyedPairLines.remove(key);
+    @Override
+	public Object remove(final Object key) {
+        final Object obj = super.remove(key);
+        final Integer i = (Integer) keyedPairLines.remove(key);
         if (null != i) {
             if (removeComments) {
                 removeCommentsEndingAt(i.intValue());
@@ -202,16 +207,17 @@ public class LayoutPreservingProperties extends Properties {
         return obj;
     }
 
-    public Object clone() {
-        LayoutPreservingProperties dolly =
+    @Override
+	public Object clone() {
+        final LayoutPreservingProperties dolly =
             (LayoutPreservingProperties) super.clone();
         dolly.keyedPairLines = (HashMap) this.keyedPairLines.clone();
         dolly.logicalLines = (ArrayList) this.logicalLines.clone();
         final int size = dolly.logicalLines.size();
         for (int j = 0; j < size; j++) {
-            LogicalLine line = (LogicalLine) dolly.logicalLines.get(j);
+            final LogicalLine line = (LogicalLine) dolly.logicalLines.get(j);
             if (line instanceof Pair) {
-                Pair p = (Pair) line;
+                final Pair p = (Pair) line;
                 dolly.logicalLines.set(j, p.clone());
             }
             // no reason to clone other lines are they are immutable
@@ -224,11 +230,11 @@ public class LayoutPreservingProperties extends Properties {
      * stream.
      * @param out the stream to write to
      */
-    public void listLines(PrintStream out) {
+    public void listLines(final PrintStream out) {
         out.println("-- logical lines --");
-        Iterator i = logicalLines.iterator();
+        final Iterator i = logicalLines.iterator();
         while (i.hasNext()) {
-            LogicalLine line = (LogicalLine) i.next();
+            final LogicalLine line = (LogicalLine) i.next();
             if (line instanceof Blank) {
                 out.println("blank:   \"" + line + "\"");
             } else if (line instanceof Comment) {
@@ -243,17 +249,18 @@ public class LayoutPreservingProperties extends Properties {
      * Save the properties to a file.
      * @param dest the file to write to
      */
-    public void saveAs(File dest) throws IOException {
-        FileOutputStream fos = new FileOutputStream(dest);
+    public void saveAs(final File dest) throws IOException {
+        final FileOutputStream fos = new FileOutputStream(dest);
         store(fos, null);
         fos.close();
     }
 
-    public void store(OutputStream out, String header) throws IOException {
-        OutputStreamWriter osw = new OutputStreamWriter(out, ResourceUtils.ISO_8859_1);
+    @Override
+	public void store(final OutputStream out, final String header) throws IOException {
+        final OutputStreamWriter osw = new OutputStreamWriter(out, ResourceUtils.ISO_8859_1);
 
         int skipLines = 0;
-        int totalLines = logicalLines.size();
+        final int totalLines = logicalLines.size();
 
         if (header != null) {
             osw.write("#" + header + LS);
@@ -274,16 +281,16 @@ public class LayoutPreservingProperties extends Properties {
                                               .get(skipLines)
                                               .toString().substring(1));
                 skipLines++;
-            } catch (java.text.ParseException pe) {
+            } catch (final java.text.ParseException pe) {
                 // not an existing date comment
             }
         }
         osw.write("#" + DateUtils.getDateForHeader() + LS);
 
         boolean writtenSep = false;
-        for (Iterator i = logicalLines.subList(skipLines, totalLines).iterator();
-             i.hasNext(); ) {
-            LogicalLine line = (LogicalLine) i.next();
+        for (final Iterator i = logicalLines.subList(skipLines, totalLines).iterator();
+             i.hasNext();) {
+            final LogicalLine line = (LogicalLine) i.next();
             if (line instanceof Pair) {
                 if (((Pair)line).isNew()) {
                     if (!writtenSep) {
@@ -306,9 +313,9 @@ public class LayoutPreservingProperties extends Properties {
      * file.
      * @param is the stream from which to read the data
      */
-    private String readLines(InputStream is) throws IOException {
-        InputStreamReader isr = new InputStreamReader(is, ResourceUtils.ISO_8859_1);
-        PushbackReader pbr = new PushbackReader(isr, 1);
+    private String readLines(final InputStream is) throws IOException {
+        final InputStreamReader isr = new InputStreamReader(is, ResourceUtils.ISO_8859_1);
+        final PushbackReader pbr = new PushbackReader(isr, 1);
 
         if (logicalLines.size() > 0) {
             // we add a blank line for spacing
@@ -316,12 +323,12 @@ public class LayoutPreservingProperties extends Properties {
         }
 
         String s = readFirstLine(pbr);
-        BufferedReader br = new BufferedReader(pbr);
+        final BufferedReader br = new BufferedReader(pbr);
 
         boolean continuation = false;
         boolean comment = false;
-        StringBuffer fileBuffer = new StringBuffer();
-        StringBuffer logicalLineBuffer = new StringBuffer();
+        final StringBuffer fileBuffer = new StringBuffer();
+        final StringBuffer logicalLineBuffer = new StringBuffer();
         while (s != null) {
             fileBuffer.append(s).append(LS);
 
@@ -349,7 +356,7 @@ public class LayoutPreservingProperties extends Properties {
                     line = new Blank();
                 } else {
                     line = new Pair(logicalLineBuffer.toString());
-                    String key = unescape(((Pair)line).getName());
+                    final String key = unescape(((Pair)line).getName());
                     if (keyedPairLines.containsKey(key)) {
                         // this key is already present, so we remove it and add
                         // the new one
@@ -376,8 +383,8 @@ public class LayoutPreservingProperties extends Properties {
      *
      * @since Ant 1.8.2
      */
-    private String readFirstLine(PushbackReader r) throws IOException {
-        StringBuffer sb = new StringBuffer(80);
+    private String readFirstLine(final PushbackReader r) throws IOException {
+        final StringBuffer sb = new StringBuffer(80);
         int ch = r.read();
         boolean hasCR = false;
         // when reaching EOF before the first EOL, assume native line
@@ -413,14 +420,14 @@ public class LayoutPreservingProperties extends Properties {
      * @return <code>true</code> if the line is to be continued,
      * <code>false</code> otherwise
      */
-    private boolean requiresContinuation(String s) {
-        char[] ca = s.toCharArray();
+    private boolean requiresContinuation(final String s) {
+        final char[] ca = s.toCharArray();
         int i = ca.length - 1;
         while (i > 0 && ca[i] == '\\') {
             i--;
         }
         // trailing backslashes
-        int tb = ca.length - i - 1;
+        final int tb = ca.length - i - 1;
         return tb % 2 == 1;
     }
 
@@ -431,7 +438,7 @@ public class LayoutPreservingProperties extends Properties {
      * @param s the string to unescape (coming from the source file)
      * @return the unescaped string
      */
-    private String unescape(String s) {
+    private String unescape(final String s) {
         /*
          * The following combinations are converted:
          * \n  newline
@@ -444,10 +451,10 @@ public class LayoutPreservingProperties extends Properties {
          * \b  becomes 'b'.
          */
 
-        char[] ch = new char[s.length() + 1];
+        final char[] ch = new char[s.length() + 1];
         s.getChars(0, s.length(), ch, 0);
         ch[s.length()] = '\n';
-        StringBuffer buffy = new StringBuffer(s.length());
+        final StringBuffer buffy = new StringBuffer(s.length());
         for (int i = 0; i < ch.length; i++) {
             char c = ch[i];
             if (c == '\n') {
@@ -485,8 +492,8 @@ public class LayoutPreservingProperties extends Properties {
      * @param ch the character array containing the unicode character code
      * @return the character extracted
      */
-    private char unescapeUnicode(char[] ch, int i) {
-        String s = new String(ch, i, 4);
+    private char unescapeUnicode(final char[] ch, final int i) {
+        final String s = new String(ch, i, 4);
         return (char) Integer.parseInt(s, 16);
     }
 
@@ -497,7 +504,7 @@ public class LayoutPreservingProperties extends Properties {
      * @param s the string to escape
      * @return the escaped string
      */
-    private String escapeValue(String s) {
+    private String escapeValue(final String s) {
         return escape(s, false);
     }
 
@@ -510,7 +517,7 @@ public class LayoutPreservingProperties extends Properties {
      * @param s the string to escape
      * @return the escaped string
      */
-    private String escapeName(String s) {
+    private String escapeName(final String s) {
         return escape(s, true);
     }
 
@@ -524,19 +531,19 @@ public class LayoutPreservingProperties extends Properties {
      * leading whitespace
      * @return the escaped string
      */
-    private String escape(String s, boolean escapeAllSpaces) {
+    private String escape(final String s, final boolean escapeAllSpaces) {
         if (s == null) {
             return null;
         }
 
-        char[] ch = new char[s.length()];
+        final char[] ch = new char[s.length()];
         s.getChars(0, s.length(), ch, 0);
-        String forEscaping = "\t\f\r\n\\:=#!";
-        String escaped = "tfrn\\:=#!";
-        StringBuffer buffy = new StringBuffer(s.length());
+        final String forEscaping = "\t\f\r\n\\:=#!";
+        final String escaped = "tfrn\\:=#!";
+        final StringBuffer buffy = new StringBuffer(s.length());
         boolean leadingSpace = true;
         for (int i = 0; i < ch.length; i++) {
-            char c = ch[i];
+            final char c = ch[i];
             if (c == ' ') {
                 if (escapeAllSpaces || leadingSpace) {
                     buffy.append("\\");
@@ -544,7 +551,7 @@ public class LayoutPreservingProperties extends Properties {
             } else {
                 leadingSpace = false;
             }
-            int p = forEscaping.indexOf(c);
+            final int p = forEscaping.indexOf(c);
             if (p != -1) {
                 buffy.append("\\").append(escaped.substring(p,p+1));
             } else if (c < 0x0020 || c > 0x007e) {
@@ -562,7 +569,7 @@ public class LayoutPreservingProperties extends Properties {
      * @param ch the character to encode
      * @return the unicode escape sequence
      */
-    private String escapeUnicode(char ch) {
+    private String escapeUnicode(final char ch) {
         return "\\" + UnicodeUtil.EscapeUnicode(ch);
         }
 
@@ -580,7 +587,7 @@ public class LayoutPreservingProperties extends Properties {
          * B1.
          */
 
-        int end = pos - 1;
+        final int end = pos - 1;
 
         // step pos back until it hits something non-blank
         for (pos = end; pos > 0; pos--) {
@@ -603,7 +610,7 @@ public class LayoutPreservingProperties extends Properties {
         }
 
         // now we want to delete from pos+1 to end
-        for (pos++ ;pos <= end; pos++) {
+        for (pos++; pos <= end; pos++) {
             logicalLines.set(pos, null);
         }
     }
@@ -611,18 +618,19 @@ public class LayoutPreservingProperties extends Properties {
     /**
      * A logical line of the properties input stream.
      */
-    private static abstract class LogicalLine {
+    private abstract static class LogicalLine {
         private String text;
 
-        public LogicalLine(String text) {
+        public LogicalLine(final String text) {
             this.text = text;
         }
 
-        public void setText(String text) {
+        public void setText(final String text) {
             this.text = text;
         }
 
-        public String toString() {
+        @Override
+		public String toString() {
             return text;
         }
     }
@@ -640,7 +648,7 @@ public class LayoutPreservingProperties extends Properties {
      * A comment line of the input stream.
      */
     private class Comment extends LogicalLine {
-        public Comment(String text) {
+        public Comment(final String text) {
             super(text);
         }
     }
@@ -655,12 +663,12 @@ public class LayoutPreservingProperties extends Properties {
         private String value;
         private boolean added;
 
-        public Pair(String text) {
+        public Pair(final String text) {
             super(text);
             parsePair(text);
         }
 
-        public Pair(String name, String value) {
+        public Pair(final String name, final String value) {
             this(name + "=" + value);
         }
 
@@ -672,7 +680,7 @@ public class LayoutPreservingProperties extends Properties {
             return value;
         }
 
-        public void setValue(String value) {
+        public void setValue(final String value) {
             this.value = value;
             setText(name + "=" + value);
         }
@@ -681,24 +689,25 @@ public class LayoutPreservingProperties extends Properties {
             return added;
         }
 
-        public void setNew(boolean val) {
+        public void setNew(final boolean val) {
             added = val;
         }
 
-        public Object clone() {
+        @Override
+		public Object clone() {
             Object dolly = null;
             try {
                 dolly = super.clone();
-            } catch (CloneNotSupportedException e) {
+            } catch (final CloneNotSupportedException e) {
                 // should be fine
                 e.printStackTrace();
             }
             return dolly;
         }
 
-        private void parsePair(String text) {
+        private void parsePair(final String text) {
             // need to find first non-escaped '=', ':', '\t' or ' '.
-            int pos = findFirstSeparator(text);
+            final int pos = findFirstSeparator(text);
             if (pos == -1) {
                 // trim leading whitespace only
                 name = text;
@@ -711,7 +720,7 @@ public class LayoutPreservingProperties extends Properties {
             name = stripStart(name, " \t\f");
         }
 
-        private String stripStart(String s, String chars) {
+        private String stripStart(final String s, final String chars) {
             if (s == null) {
                 return null;
             }
@@ -745,14 +754,14 @@ public class LayoutPreservingProperties extends Properties {
             return indexOfAny(s, " :=\t");
         }
 
-        private int indexOfAny(String s, String chars) {
+        private int indexOfAny(final String s, final String chars) {
             if (s == null || chars == null) {
                 return -1;
             }
 
             int p = s.length() + 1;
             for (int i = 0; i < chars.length(); i++) {
-                int x = s.indexOf(chars.charAt(i));
+                final int x = s.indexOf(chars.charAt(i));
                 if (x != -1 && x < p) {
                     p = x;
                 }

http://git-wip-us.apache.org/repos/asf/ant/blob/1b76f1b6/src/main/org/apache/tools/ant/util/LineOrientedOutputStream.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/util/LineOrientedOutputStream.java b/src/main/org/apache/tools/ant/util/LineOrientedOutputStream.java
index 3c0df4d..7630f59 100644
--- a/src/main/org/apache/tools/ant/util/LineOrientedOutputStream.java
+++ b/src/main/org/apache/tools/ant/util/LineOrientedOutputStream.java
@@ -50,7 +50,8 @@ public abstract class LineOrientedOutputStream extends OutputStream {
      * @param cc data to log (byte).
      * @throws IOException if there is an error.
      */
-    public final void write(int cc) throws IOException {
+    @Override
+	public final void write(int cc) throws IOException {
         final byte c = (byte) cc;
         if ((c == LF) || (c == CR)) {
             if (!skip) {
@@ -66,7 +67,8 @@ public abstract class LineOrientedOutputStream extends OutputStream {
      * Flush this log stream
      * @throws IOException if there is an error.
      */
-    public void flush() throws IOException {
+    @Override
+	public void flush() throws IOException {
     }
 
     /**
@@ -111,7 +113,8 @@ public abstract class LineOrientedOutputStream extends OutputStream {
      * Writes all remaining
      * @throws IOException if there is an error.
      */
-    public void close() throws IOException {
+    @Override
+	public void close() throws IOException {
         if (buffer.size() > 0) {
             processBuffer();
         }
@@ -127,7 +130,8 @@ public abstract class LineOrientedOutputStream extends OutputStream {
      *
      * @throws IOException if the data cannot be written into the stream.
      */
-    public final void write(byte[] b, int off, int len) throws IOException {
+    @Override
+	public final void write(byte[] b, int off, int len) throws IOException {
         // find the line breaks and pass other chars through in blocks
         int offset = off;
         int blockStartOffset = offset;


Mime
View raw message