ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gin...@apache.org
Subject [3/6] ant git commit: Checkstyle: whitespace, line continuation and modifier idiosyncrasies
Date Mon, 11 Dec 2017 22:44:45 GMT
http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/main/org/apache/tools/tar/TarEntry.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/tar/TarEntry.java b/src/main/org/apache/tools/tar/TarEntry.java
index fad702f..c44e47f 100644
--- a/src/main/org/apache/tools/tar/TarEntry.java
+++ b/src/main/org/apache/tools/tar/TarEntry.java
@@ -989,34 +989,33 @@ public class TarEntry implements TarConstants {
 
         int type = evaluateType(header);
         switch (type) {
-        case FORMAT_OLDGNU: {
-            offset += ATIMELEN_GNU;
-            offset += CTIMELEN_GNU;
-            offset += OFFSETLEN_GNU;
-            offset += LONGNAMESLEN_GNU;
-            offset += PAD2LEN_GNU;
-            offset += SPARSELEN_GNU;
-            isExtended = TarUtils.parseBoolean(header, offset);
-            offset += ISEXTENDEDLEN_GNU;
-            realSize = TarUtils.parseOctal(header, offset, REALSIZELEN_GNU);
-            offset += REALSIZELEN_GNU;
-            break;
-        }
-        case FORMAT_POSIX:
-        default: {
-            String prefix = oldStyle
-                ? TarUtils.parseName(header, offset, PREFIXLEN)
-                : TarUtils.parseName(header, offset, PREFIXLEN, encoding);
-            // SunOS tar -E does not add / to directory names, so fix
-            // up to be consistent
-            if (isDirectory() && !name.endsWith("/")) {
-                name = name + "/";
+            case FORMAT_OLDGNU: {
+                offset += ATIMELEN_GNU;
+                offset += CTIMELEN_GNU;
+                offset += OFFSETLEN_GNU;
+                offset += LONGNAMESLEN_GNU;
+                offset += PAD2LEN_GNU;
+                offset += SPARSELEN_GNU;
+                isExtended = TarUtils.parseBoolean(header, offset);
+                offset += ISEXTENDEDLEN_GNU;
+                realSize = TarUtils.parseOctal(header, offset, REALSIZELEN_GNU);
+                offset += REALSIZELEN_GNU;
+                break;
             }
-            if (prefix.length() > 0) {
-                name = prefix + "/" + name;
+            case FORMAT_POSIX:
+            default: {
+                String prefix = oldStyle ? TarUtils.parseName(header, offset, PREFIXLEN)
+                        : TarUtils.parseName(header, offset, PREFIXLEN, encoding);
+                // SunOS tar -E does not add / to directory names, so fix
+                // up to be consistent
+                if (isDirectory() && !name.endsWith("/")) {
+                    name = name + "/";
+                }
+                if (prefix.length() > 0) {
+                    name = prefix + "/" + name;
+                }
             }
         }
-        }
     }
 
     /**
@@ -1116,9 +1115,9 @@ public class TarEntry implements TarConstants {
             final byte[] buffer1, final int offset1, final int length1,
             final byte[] buffer2, final int offset2, final int length2,
             boolean ignoreTrailingNulls) {
-        int minLen=length1 < length2 ? length1 : length2;
-        for (int i=0; i < minLen; i++) {
-            if (buffer1[offset1+i] != buffer2[offset2+i]) {
+        int minLen = (length1 < length2) ? length1 : length2;
+        for (int i = 0; i < minLen; i++) {
+            if (buffer1[offset1 + i] != buffer2[offset2 + i]) {
                 return false;
             }
         }
@@ -1126,15 +1125,15 @@ public class TarEntry implements TarConstants {
             return true;
         }
         if (ignoreTrailingNulls) {
-            if (length1 > length2){
-                for(int i = length2; i < length1; i++){
-                    if (buffer1[offset1+i] != 0) {
+            if (length1 > length2) {
+                for (int i = length2; i < length1; i++) {
+                    if (buffer1[offset1 + i] != 0) {
                         return false;
                     }
                 }
             } else {
-                for (int i = length1; i < length2; i++){
-                    if (buffer2[offset2+i] != 0) {
+                for (int i = length1; i < length2; i++) {
+                    if (buffer2[offset2 + i] != 0) {
                         return false;
                     }
                 }

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/main/org/apache/tools/tar/TarInputStream.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/tar/TarInputStream.java b/src/main/org/apache/tools/tar/TarInputStream.java
index bacc200..9715992 100644
--- a/src/main/org/apache/tools/tar/TarInputStream.java
+++ b/src/main/org/apache/tools/tar/TarInputStream.java
@@ -331,11 +331,11 @@ public class TarInputStream extends FilterInputStream {
             currEntry.setName(encoding.decode(longNameData));
         }
 
-        if (currEntry.isPaxHeader()){ // Process Pax headers
+        if (currEntry.isPaxHeader()) { // Process Pax headers
             paxHeaders();
         }
 
-        if (currEntry.isGNUSparse()){ // Process sparse files
+        if (currEntry.isGNUSparse()) { // Process sparse files
             readGNUSparse();
         }
 
@@ -414,7 +414,7 @@ public class TarInputStream extends FilterInputStream {
         return hasHitEOF ? null : headerBuf;
     }
 
-    private void paxHeaders() throws IOException{
+    private void paxHeaders() throws IOException {
         Map<String, String> headers = parsePaxHeaders(this);
         getNextEntry(); // Get the actual file entry
         applyPaxHeadersToCurrentEntry(headers);
@@ -423,18 +423,18 @@ public class TarInputStream extends FilterInputStream {
     Map<String, String> parsePaxHeaders(InputStream i) throws IOException {
         Map<String, String> headers = new HashMap<String, String>();
         // Format is "length keyword=value\n";
-        while(true){ // get length
+        while (true) { // get length
             int ch;
             int len = 0;
             int read = 0;
-            while((ch = i.read()) != -1) {
+            while ((ch = i.read()) != -1) {
                 read++;
-                if (ch == ' '){ // End of length string
+                if (ch == ' ') { // End of length string
                     // Get keyword
                     ByteArrayOutputStream coll = new ByteArrayOutputStream();
-                    while((ch = i.read()) != -1) {
+                    while ((ch = i.read()) != -1) {
                         read++;
-                        if (ch == '='){ // end of keyword
+                        if (ch == '=') { // end of keyword
                             String keyword = coll.toString("UTF-8");
                             // Get rest of entry
                             final int restLen = len - read;
@@ -463,7 +463,7 @@ public class TarInputStream extends FilterInputStream {
                 len *= 10;
                 len += ch - '0';
             }
-            if (ch == -1){ // EOF
+            if (ch == -1) { // EOF
                 break;
             }
         }
@@ -482,28 +482,28 @@ public class TarInputStream extends FilterInputStream {
          * uid,uname
          * SCHILY.devminor, SCHILY.devmajor: don't have setters/getters for those
          */
-        for (Entry<String, String> ent : headers.entrySet()){
+        for (Entry<String, String> ent : headers.entrySet()) {
             String key = ent.getKey();
             String val = ent.getValue();
-            if ("path".equals(key)){
+            if ("path".equals(key)) {
                 currEntry.setName(val);
-            } else if ("linkpath".equals(key)){
+            } else if ("linkpath".equals(key)) {
                 currEntry.setLinkName(val);
-            } else if ("gid".equals(key)){
+            } else if ("gid".equals(key)) {
                 currEntry.setGroupId(Long.parseLong(val));
-            } else if ("gname".equals(key)){
+            } else if ("gname".equals(key)) {
                 currEntry.setGroupName(val);
-            } else if ("uid".equals(key)){
+            } else if ("uid".equals(key)) {
                 currEntry.setUserId(Long.parseLong(val));
-            } else if ("uname".equals(key)){
+            } else if ("uname".equals(key)) {
                 currEntry.setUserName(val);
-            } else if ("size".equals(key)){
+            } else if ("size".equals(key)) {
                 currEntry.setSize(Long.parseLong(val));
-            } else if ("mtime".equals(key)){
+            } else if ("mtime".equals(key)) {
                 currEntry.setModTime((long) (Double.parseDouble(val) * 1000));
-            } else if ("SCHILY.devminor".equals(key)){
+            } else if ("SCHILY.devminor".equals(key)) {
                 currEntry.setDevMinor(Integer.parseInt(val));
-            } else if ("SCHILY.devmajor".equals(key)){
+            } else if ("SCHILY.devmajor".equals(key)) {
                 currEntry.setDevMajor(Integer.parseInt(val));
             }
         }

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/main/org/apache/tools/tar/TarOutputStream.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/tar/TarOutputStream.java b/src/main/org/apache/tools/tar/TarOutputStream.java
index f2f0943..217ed20 100644
--- a/src/main/org/apache/tools/tar/TarOutputStream.java
+++ b/src/main/org/apache/tools/tar/TarOutputStream.java
@@ -246,7 +246,7 @@ public class TarOutputStream extends FilterOutputStream {
      */
     @Override
     public void close() throws IOException {
-        if(!finished) {
+        if (!finished) {
             finish();
         }
 
@@ -279,7 +279,7 @@ public class TarOutputStream extends FilterOutputStream {
      * @throws IOException on error
      */
     public void putNextEntry(TarEntry entry) throws IOException {
-        if(finished) {
+        if (finished) {
             throw new IOException("Stream has already been finished");
         }
         Map<String, String> paxHeaders = new HashMap<String, String>();
@@ -342,7 +342,7 @@ public class TarOutputStream extends FilterOutputStream {
         if (finished) {
             throw new IOException("Stream has already been finished");
         }
-        if (!haveUnclosedEntry){
+        if (!haveUnclosedEntry) {
             throw new IOException("No current entry to close");
         }
         if (assemLen > 0) {
@@ -624,7 +624,7 @@ public class TarOutputStream extends FilterOutputStream {
      * @param fieldName the name of the field
      * @return whether a pax header has been written.
      */
-    private boolean handleLongName(TarEntry entry , String name,
+    private boolean handleLongName(TarEntry entry, String name,
                                    Map<String, String> paxHeaders,
                                    String paxHeaderName, byte linkType, String fieldName)
         throws IOException {

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/main/org/apache/tools/tar/TarUtils.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/tar/TarUtils.java b/src/main/org/apache/tools/tar/TarUtils.java
index 70e6a44..93d1583 100644
--- a/src/main/org/apache/tools/tar/TarUtils.java
+++ b/src/main/org/apache/tools/tar/TarUtils.java
@@ -46,7 +46,9 @@ public class TarUtils {
      * Encapsulates the algorithms used up to Ant 1.8 as ZipEncoding.
      */
     static final ZipEncoding FALLBACK_ENCODING = new ZipEncoding() {
-            public boolean canEncode(final String name) { return true; }
+            public boolean canEncode(final String name) {
+                return true;
+            }
 
             public ByteBuffer encode(final String name) {
                 final int length = name.length();
@@ -76,7 +78,7 @@ public class TarUtils {
         };
 
     /** Private constructor to prevent instantiation of this utility class. */
-    private TarUtils(){
+    private TarUtils() {
     }
 
     /**
@@ -105,8 +107,8 @@ public class TarUtils {
         int     end = offset + length;
         int     start = offset;
 
-        if (length < 2){
-            throw new IllegalArgumentException("Length "+length+" must be at least 2");
+        if (length < 2) {
+            throw new IllegalArgumentException("Length " + length + " must be at least 2");
         }
 
         if (buffer[start] == 0) {
@@ -114,8 +116,8 @@ public class TarUtils {
         }
 
         // Skip leading spaces
-        while (start < end){
-            if (buffer[start] == ' '){
+        while (start < end) {
+            if (buffer[start] == ' ') {
                 start++;
             } else {
                 break;
@@ -132,15 +134,16 @@ public class TarUtils {
             trailer = buffer[end - 1];
         }
 
-        for ( ;start < end; start++) {
+        while (start < end) {
             final byte currentByte = buffer[start];
             // CheckStyle:MagicNumber OFF
-            if (currentByte < '0' || currentByte > '7'){
+            if (currentByte < '0' || currentByte > '7') {
                 throw new IllegalArgumentException(
                         exceptionMessage(buffer, offset, length, start, currentByte));
             }
             result = (result << 3) + (currentByte - '0'); // convert from ASCII
             // CheckStyle:MagicNumber ON
+            start++;
         }
 
         return result;
@@ -179,10 +182,9 @@ public class TarUtils {
                                         final int length,
                                         final boolean negative) {
         if (length >= 9) {
-            throw new IllegalArgumentException("At offset " + offset + ", "
-                                               + length + " byte binary number"
-                                               + " exceeds maximum signed long"
-                                               + " value");
+            throw new IllegalArgumentException(String.format(
+                    "At offset %d, %d byte binary number exceeds maximum signed long value",
+                    offset, length));
         }
         long val = 0;
         for (int i = 1; i < length; i++) {
@@ -208,10 +210,9 @@ public class TarUtils {
             val = val.add(BigInteger.valueOf(-1)).not();
         }
         if (val.bitLength() > 63) {
-            throw new IllegalArgumentException("At offset " + offset + ", "
-                                               + length + " byte binary number"
-                                               + " exceeds maximum signed long"
-                                               + " value");
+            throw new IllegalArgumentException(String.format(
+                    "At offset %d, %d byte binary number exceeds maximum signed long value",
+                    offset, length));
         }
         return negative ? -val.longValue() : val.longValue();
     }
@@ -242,9 +243,9 @@ public class TarUtils {
         // can throw an IOException which parseOctal* doesn't declare
         String string = new String(buffer, offset, length);
 
-        string=string.replaceAll("\0", "{NUL}"); // Replace NULs to allow string to be printed
-        final String s = "Invalid byte "+currentByte+" at offset "+(current-offset)+" in '"+string+"' len="+length;
-        return s;
+        string = string.replaceAll("\0", "{NUL}"); // Replace NULs to allow string to be printed
+        return String.format("Invalid byte %s at offset %d in '%s' len=%d",
+                currentByte, current - offset, string, length);
     }
 
     /**
@@ -390,9 +391,10 @@ public class TarUtils {
                 val = val >>> 3;
                 // CheckStyle:MagicNumber ON
             }
-            if (val != 0){
-                throw new IllegalArgumentException
-                (value+"="+Long.toOctalString(value)+ " will not fit in octal number buffer of length "+length);
+            if (val != 0) {
+                throw new IllegalArgumentException(String.format(
+                        "%d=%s will not fit in octal number buffer of length %d",
+                        value, Long.toOctalString(value), length));
             }
         }
 
@@ -417,7 +419,7 @@ public class TarUtils {
      */
     public static int formatOctalBytes(final long value, final byte[] buf, final int offset, final int length) {
 
-        int idx=length-2; // For space and trailing null
+        int idx = length - 2; // For space and trailing null
         formatUnsignedOctalString(value, buf, offset, idx);
 
         buf[offset + idx++] = (byte) ' '; // Trailing space
@@ -442,7 +444,7 @@ public class TarUtils {
      */
     public static int formatLongOctalBytes(final long value, final byte[] buf, final int offset, final int length) {
 
-        final int idx=length-1; // For space
+        final int idx = length - 1; // For space
 
         formatUnsignedOctalString(value, buf, offset, idx);
         buf[offset + idx] = (byte) ' '; // Trailing space
@@ -538,11 +540,11 @@ public class TarUtils {
      */
     public static int formatCheckSumOctalBytes(final long value, final byte[] buf, final int offset, final int length) {
 
-        int idx=length-2; // for NUL and space
+        int idx = length - 2; // for NUL and space
         formatUnsignedOctalString(value, buf, offset, idx);
 
-        buf[offset + idx++]   = 0; // Trailing null
-        buf[offset + idx]     = (byte) ' '; // Trailing space
+        buf[offset + idx++] = 0; // Trailing null
+        buf[offset + idx]   = (byte) ' '; // Trailing space
 
         return offset + length;
     }

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/main/org/apache/tools/zip/ExtraFieldUtils.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/zip/ExtraFieldUtils.java b/src/main/org/apache/tools/zip/ExtraFieldUtils.java
index d7a6c9d..18bb850 100644
--- a/src/main/org/apache/tools/zip/ExtraFieldUtils.java
+++ b/src/main/org/apache/tools/zip/ExtraFieldUtils.java
@@ -140,45 +140,38 @@ public class ExtraFieldUtils {
             ZipShort headerId = new ZipShort(data, start);
             int length = (new ZipShort(data, start + 2)).getValue();
             if (start + WORD + length > data.length) {
-                switch(onUnparseableData.getKey()) {
-                case UnparseableExtraField.THROW_KEY:
-                    throw new ZipException("bad extra field starting at "
-                                           + start + ".  Block length of "
-                                           + length + " bytes exceeds remaining"
-                                           + " data of "
-                                           + (data.length - start - WORD)
-                                           + " bytes.");
-                case UnparseableExtraField.READ_KEY:
-                    UnparseableExtraFieldData field =
-                        new UnparseableExtraFieldData();
-                    if (local) {
-                        field.parseFromLocalFileData(data, start,
-                                                     data.length - start);
-                    } else {
-                        field.parseFromCentralDirectoryData(data, start,
-                                                            data.length - start);
-                    }
-                    v.add(field);
-                    //$FALL-THROUGH$
-                case UnparseableExtraField.SKIP_KEY:
-                    // since we cannot parse the data we must assume
-                    // the extra field consumes the whole rest of the
-                    // available data
-                    break LOOP;
-                default:
-                    throw new ZipException("unknown UnparseableExtraField key: "
-                                           + onUnparseableData.getKey());
+                switch (onUnparseableData.getKey()) {
+                    case UnparseableExtraField.THROW_KEY:
+                        throw new ZipException("bad extra field starting at "
+                                + start + ".  Block length of " + length
+                                + " bytes exceeds remaining data of "
+                                + (data.length - start - WORD) + " bytes.");
+                    case UnparseableExtraField.READ_KEY:
+                        UnparseableExtraFieldData field = new UnparseableExtraFieldData();
+                        if (local) {
+                            field.parseFromLocalFileData(data, start, data.length - start);
+                        } else {
+                            field.parseFromCentralDirectoryData(data, start, data.length - start);
+                        }
+                        v.add(field);
+                        //$FALL-THROUGH$
+                    case UnparseableExtraField.SKIP_KEY:
+                        // since we cannot parse the data we must assume
+                        // the extra field consumes the whole rest of the
+                        // available data
+                        break LOOP;
+                    default:
+                        throw new ZipException("unknown UnparseableExtraField key: "
+                                + onUnparseableData.getKey());
                 }
             }
             try {
                 ZipExtraField ze = createExtraField(headerId);
-                if (local
-                    || !(ze instanceof CentralDirectoryParsingZipExtraField)) {
+                if (local || !(ze instanceof CentralDirectoryParsingZipExtraField)) {
                     ze.parseFromLocalFileData(data, start + WORD, length);
                 } else {
                     ((CentralDirectoryParsingZipExtraField) ze)
-                        .parseFromCentralDirectoryData(data, start + WORD,
-                                                       length);
+                        .parseFromCentralDirectoryData(data, start + WORD, length);
                 }
                 v.add(ze);
             } catch (InstantiationException ie) {
@@ -201,9 +194,8 @@ public class ExtraFieldUtils {
      */
     public static byte[] mergeLocalFileDataData(ZipExtraField[] data) {
         final boolean lastIsUnparseableHolder = data.length > 0
-            && data[data.length - 1] instanceof UnparseableExtraFieldData;
-        int regularExtraFieldCount =
-            lastIsUnparseableHolder ? data.length - 1 : data.length;
+                && data[data.length - 1] instanceof UnparseableExtraFieldData;
+        int regularExtraFieldCount = lastIsUnparseableHolder ? data.length - 1 : data.length;
 
         int sum = WORD * regularExtraFieldCount;
         for (ZipExtraField element : data) {
@@ -214,9 +206,9 @@ public class ExtraFieldUtils {
         int start = 0;
         for (int i = 0; i < regularExtraFieldCount; i++) {
             System.arraycopy(data[i].getHeaderId().getBytes(),
-                             0, result, start, 2);
+                    0, result, start, 2);
             System.arraycopy(data[i].getLocalFileDataLength().getBytes(),
-                             0, result, start + 2, 2);
+                    0, result, start + 2, 2);
             byte[] local = data[i].getLocalFileDataData();
             System.arraycopy(local, 0, result, start + WORD, local.length);
             start += (local.length + WORD);
@@ -237,8 +229,7 @@ public class ExtraFieldUtils {
     public static byte[] mergeCentralDirectoryData(ZipExtraField[] data) {
         final boolean lastIsUnparseableHolder = data.length > 0
             && data[data.length - 1] instanceof UnparseableExtraFieldData;
-        int regularExtraFieldCount =
-            lastIsUnparseableHolder ? data.length - 1 : data.length;
+        int regularExtraFieldCount = lastIsUnparseableHolder ? data.length - 1 : data.length;
 
         int sum = WORD * regularExtraFieldCount;
         for (ZipExtraField element : data) {
@@ -283,22 +274,19 @@ public class ExtraFieldUtils {
         /**
          * Throw an exception if field cannot be parsed.
          */
-        public static final UnparseableExtraField THROW
-            = new UnparseableExtraField(THROW_KEY);
+        public static final UnparseableExtraField THROW = new UnparseableExtraField(THROW_KEY);
 
         /**
          * Skip the extra field entirely and don't make its data
          * available - effectively removing the extra field data.
          */
-        public static final UnparseableExtraField SKIP
-            = new UnparseableExtraField(SKIP_KEY);
+        public static final UnparseableExtraField SKIP = new UnparseableExtraField(SKIP_KEY);
 
         /**
          * Read the extra field data into an instance of {@link
          * UnparseableExtraFieldData UnparseableExtraFieldData}.
          */
-        public static final UnparseableExtraField READ
-            = new UnparseableExtraField(READ_KEY);
+        public static final UnparseableExtraField READ = new UnparseableExtraField(READ_KEY);
 
         private final int key;
 
@@ -311,6 +299,8 @@ public class ExtraFieldUtils {
          *
          * @return int
          */
-        public int getKey() { return key; }
+        public int getKey() {
+            return key;
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/main/org/apache/tools/zip/FallbackZipEncoding.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/zip/FallbackZipEncoding.java b/src/main/org/apache/tools/zip/FallbackZipEncoding.java
index 96cff33..7e0f315 100644
--- a/src/main/org/apache/tools/zip/FallbackZipEncoding.java
+++ b/src/main/org/apache/tools/zip/FallbackZipEncoding.java
@@ -85,7 +85,7 @@ class FallbackZipEncoding implements ZipEncoding {
         if (this.charset == null) { // i.e. use default charset, see no-args constructor
             return new String(data);
         } else {
-            return new String(data,this.charset);
+            return new String(data, this.charset);
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/main/org/apache/tools/zip/GeneralPurposeBit.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/zip/GeneralPurposeBit.java b/src/main/org/apache/tools/zip/GeneralPurposeBit.java
index 3246fbe..f5f353c 100644
--- a/src/main/org/apache/tools/zip/GeneralPurposeBit.java
+++ b/src/main/org/apache/tools/zip/GeneralPurposeBit.java
@@ -27,7 +27,7 @@ public final class GeneralPurposeBit implements Cloneable {
     /**
      * Indicates that the file is encrypted.
      */
-    private static final int ENCRYPTION_FLAG = 1 << 0;
+    private static final int ENCRYPTION_FLAG = 1;
 
     /**
      * Indicates that a data descriptor stored after the file contents
@@ -155,13 +155,10 @@ public final class GeneralPurposeBit implements Cloneable {
      */
     public void encode(byte[] buf, int offset) {
         ZipShort.putShort((dataDescriptorFlag ? DATA_DESCRIPTOR_FLAG : 0)
-                          |
-                          (languageEncodingFlag ? UFT8_NAMES_FLAG : 0)
-                          |
-                          (encryptionFlag ? ENCRYPTION_FLAG : 0)
-                          |
-                          (strongEncryptionFlag ? STRONG_ENCRYPTION_FLAG : 0)
-                          , buf, offset);
+                          | (languageEncodingFlag ? UFT8_NAMES_FLAG : 0)
+                          | (encryptionFlag ? ENCRYPTION_FLAG : 0)
+                          | (strongEncryptionFlag ? STRONG_ENCRYPTION_FLAG : 0),
+                buf, offset);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/main/org/apache/tools/zip/NioZipEncoding.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/zip/NioZipEncoding.java b/src/main/org/apache/tools/zip/NioZipEncoding.java
index 462b519..f566615 100644
--- a/src/main/org/apache/tools/zip/NioZipEncoding.java
+++ b/src/main/org/apache/tools/zip/NioZipEncoding.java
@@ -75,7 +75,7 @@ class NioZipEncoding implements ZipEncoding {
                                              + (name.length() + 1) / 2);
 
         while (cb.remaining() > 0) {
-            final CoderResult res = enc.encode(cb, out,true);
+            final CoderResult res = enc.encode(cb, out, true);
 
             if (res.isUnmappable() || res.isMalformed()) {
 
@@ -86,8 +86,8 @@ class NioZipEncoding implements ZipEncoding {
                                                        + res.length() * 6);
                 }
 
-                for (int i=0; i<res.length(); ++i) {
-                    ZipEncodingHelper.appendSurrogate(out,cb.get());
+                for (int i = 0; i < res.length(); ++i) {
+                    ZipEncodingHelper.appendSurrogate(out, cb.get());
                 }
 
             } else if (res.isOverflow()) {

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/main/org/apache/tools/zip/Simple8BitZipEncoding.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/zip/Simple8BitZipEncoding.java b/src/main/org/apache/tools/zip/Simple8BitZipEncoding.java
index cd40070..261beec 100644
--- a/src/main/org/apache/tools/zip/Simple8BitZipEncoding.java
+++ b/src/main/org/apache/tools/zip/Simple8BitZipEncoding.java
@@ -216,7 +216,7 @@ class Simple8BitZipEncoding implements ZipEncoding {
      */
     public boolean canEncode(final String name) {
 
-        for (int i=0;i<name.length();++i) {
+        for (int i = 0; i < name.length(); ++i) {
 
             final char c = name.charAt(i);
 
@@ -235,17 +235,15 @@ class Simple8BitZipEncoding implements ZipEncoding {
         ByteBuffer out = ByteBuffer.allocate(name.length()
                                              + 6 + (name.length() + 1) / 2);
 
-        for (int i=0;i<name.length();++i) {
-
+        for (int i = 0; i < name.length(); ++i) {
             final char c = name.charAt(i);
 
             if (out.remaining() < 6) {
-                out = ZipEncodingHelper.growBuffer(out,out.position() + 6);
+                out = ZipEncodingHelper.growBuffer(out, out.position() + 6);
             }
 
-            if (!this.pushEncodedChar(out,c)) {
-
-                ZipEncodingHelper.appendSurrogate(out,c);
+            if (!this.pushEncodedChar(out, c)) {
+                ZipEncodingHelper.appendSurrogate(out, c);
             }
         }
 
@@ -258,9 +256,9 @@ class Simple8BitZipEncoding implements ZipEncoding {
      * @see org.apache.tools.zip.ZipEncoding#decode(byte[])
      */
     public String decode(final byte[] data) throws IOException {
-        final char [] ret = new char[data.length];
+        final char[] ret = new char[data.length];
 
-        for (int i=0;i<data.length;++i) {
+        for (int i = 0; i < data.length; ++i) {
             ret[i] = this.decodeByte(data[i]);
         }
 

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/main/org/apache/tools/zip/UnicodeCommentExtraField.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/zip/UnicodeCommentExtraField.java b/src/main/org/apache/tools/zip/UnicodeCommentExtraField.java
index ccc51fa..62be2a3 100644
--- a/src/main/org/apache/tools/zip/UnicodeCommentExtraField.java
+++ b/src/main/org/apache/tools/zip/UnicodeCommentExtraField.java
@@ -32,7 +32,7 @@ public class UnicodeCommentExtraField extends AbstractUnicodeExtraField {
 
     public static final ZipShort UCOM_ID = new ZipShort(0x6375);
 
-    public UnicodeCommentExtraField () {
+    public UnicodeCommentExtraField() {
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/main/org/apache/tools/zip/UnixStat.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/zip/UnixStat.java b/src/main/org/apache/tools/zip/UnixStat.java
index 2ca0674..0863759 100644
--- a/src/main/org/apache/tools/zip/UnixStat.java
+++ b/src/main/org/apache/tools/zip/UnixStat.java
@@ -30,7 +30,7 @@ public interface UnixStat {
      *
      * @since 1.1
      */
-    int PERM_MASK =           07777;
+    int PERM_MASK =         07777;
     /**
      * Indicates symbolic links.
      *
@@ -48,7 +48,7 @@ public interface UnixStat {
      *
      * @since 1.1
      */
-    int DIR_FLAG =           040000;
+    int DIR_FLAG =          040000;
 
     // ----------------------------------------------------------
     // somewhat arbitrary choices that are quite common for shared
@@ -60,17 +60,17 @@ public interface UnixStat {
      *
      * @since 1.1
      */
-    int DEFAULT_LINK_PERM =    0777;
+    int DEFAULT_LINK_PERM = 0777;
     /**
      * Default permissions for directories.
      *
      * @since 1.1
      */
-    int DEFAULT_DIR_PERM =     0755;
+    int DEFAULT_DIR_PERM =  0755;
     /**
      * Default permissions for plain files.
      *
      * @since 1.1
      */
-    int DEFAULT_FILE_PERM =    0644;
+    int DEFAULT_FILE_PERM = 0644;
 }

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/main/org/apache/tools/zip/UnsupportedZipFeatureException.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/zip/UnsupportedZipFeatureException.java b/src/main/org/apache/tools/zip/UnsupportedZipFeatureException.java
index 52df40d..34e2117 100644
--- a/src/main/org/apache/tools/zip/UnsupportedZipFeatureException.java
+++ b/src/main/org/apache/tools/zip/UnsupportedZipFeatureException.java
@@ -28,7 +28,7 @@ import java.util.zip.ZipException;
 public class UnsupportedZipFeatureException extends ZipException {
 
     private final Feature reason;
-    private transient final ZipEntry entry;
+    private final transient ZipEntry entry;
     private static final long serialVersionUID = 20161221L;
 
     /**
@@ -65,6 +65,7 @@ public class UnsupportedZipFeatureException extends ZipException {
     /**
      * ZIP Features that may or may not be supported.
      */
+    @SuppressWarnings("serial")
     public static class Feature implements java.io.Serializable {
         /**
          * The entry is encrypted.

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/main/org/apache/tools/zip/Zip64ExtendedInformationExtraField.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/zip/Zip64ExtendedInformationExtraField.java b/src/main/org/apache/tools/zip/Zip64ExtendedInformationExtraField.java
index 2cc0a53..40a4e4b 100644
--- a/src/main/org/apache/tools/zip/Zip64ExtendedInformationExtraField.java
+++ b/src/main/org/apache/tools/zip/Zip64ExtendedInformationExtraField.java
@@ -72,7 +72,6 @@ public class Zip64ExtendedInformationExtraField
      *
      * @param size the entry's original size
      * @param compressedSize the entry's compressed size
-     *
      * @throws IllegalArgumentException if size or compressedSize is null
      */
     public Zip64ExtendedInformationExtraField(ZipEightByteInteger size,

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/main/org/apache/tools/zip/ZipEightByteInteger.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/zip/ZipEightByteInteger.java b/src/main/org/apache/tools/zip/ZipEightByteInteger.java
index 8d582dd..ca29160 100644
--- a/src/main/org/apache/tools/zip/ZipEightByteInteger.java
+++ b/src/main/org/apache/tools/zip/ZipEightByteInteger.java
@@ -82,7 +82,7 @@ public final class ZipEightByteInteger {
      * Create instance from bytes.
      * @param bytes the bytes to store as a ZipEightByteInteger
      */
-    public ZipEightByteInteger (byte[] bytes) {
+    public ZipEightByteInteger(byte[] bytes) {
         this(bytes, 0);
     }
 
@@ -91,7 +91,7 @@ public final class ZipEightByteInteger {
      * @param bytes the bytes to store as a ZipEightByteInteger
      * @param offset the offset to start
      */
-    public ZipEightByteInteger (byte[] bytes, int offset) {
+    public ZipEightByteInteger(byte[] bytes, int offset) {
         value = ZipEightByteInteger.getValue(bytes, offset);
     }
 

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/main/org/apache/tools/zip/ZipEncoding.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/zip/ZipEncoding.java b/src/main/org/apache/tools/zip/ZipEncoding.java
index 719caf5..1e0034a 100644
--- a/src/main/org/apache/tools/zip/ZipEncoding.java
+++ b/src/main/org/apache/tools/zip/ZipEncoding.java
@@ -80,5 +80,5 @@ public interface ZipEncoding {
      * @return The decoded string.
      * @throws IOException if something goes wrong
      */
-    String decode(byte [] data) throws IOException;
+    String decode(byte[] data) throws IOException;
 }

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/main/org/apache/tools/zip/ZipEncodingHelper.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/zip/ZipEncodingHelper.java b/src/main/org/apache/tools/zip/ZipEncodingHelper.java
index 4d3dab9..b9d4447 100644
--- a/src/main/org/apache/tools/zip/ZipEncodingHelper.java
+++ b/src/main/org/apache/tools/zip/ZipEncodingHelper.java
@@ -37,7 +37,7 @@ public abstract class ZipEncodingHelper {
      */
     private static class SimpleEncodingHolder {
 
-        private final char [] highChars;
+        private final char[] highChars;
         private Simple8BitZipEncoding encoding;
 
         /**
@@ -47,7 +47,7 @@ public abstract class ZipEncodingHelper {
          *
          * @see Simple8BitZipEncoding#Simple8BitZipEncoding(char[])
          */
-        SimpleEncodingHolder(final char [] highChars) {
+        SimpleEncodingHolder(final char[] highChars) {
             this.highChars = highChars;
         }
 
@@ -142,7 +142,7 @@ public abstract class ZipEncodingHelper {
      * @param b The original buffer.
      * @param newCapacity The minimal requested new capacity.
      * @return A byte buffer <code>r</code> with
-     *         <code>r.capacity() = max(b.capacity()*2,newCapacity)</code> and
+     *         <code>r.capacity() = max(b.capacity() * 2,newCapacity)</code> and
      *         all the data contained in <code>b</code> copied to the beginning
      *         of <code>r</code>.
      *
@@ -163,8 +163,7 @@ public abstract class ZipEncodingHelper {
      * The hexadecimal digits <code>0,...,9,A,...,F</code> encoded as
      * ASCII bytes.
      */
-    private static final byte[] HEX_DIGITS =
-        new byte [] {
+    private static final byte[] HEX_DIGITS = new byte[] {
         0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41,
         0x42, 0x43, 0x44, 0x45, 0x46
     };
@@ -181,9 +180,9 @@ public abstract class ZipEncodingHelper {
         bb.put((byte) '%');
         bb.put((byte) 'U');
 
-        bb.put(HEX_DIGITS[(c >> 12)&0x0f]);
-        bb.put(HEX_DIGITS[(c >> 8)&0x0f]);
-        bb.put(HEX_DIGITS[(c >> 4)&0x0f]);
+        bb.put(HEX_DIGITS[(c >> 12) & 0x0f]);
+        bb.put(HEX_DIGITS[(c >> 8) & 0x0f]);
+        bb.put(HEX_DIGITS[(c >> 4) & 0x0f]);
         bb.put(HEX_DIGITS[c & 0x0f]);
     }
 
@@ -223,7 +222,7 @@ public abstract class ZipEncodingHelper {
 
         final SimpleEncodingHolder h = simpleEncodings.get(name);
 
-        if (h!=null) {
+        if (h != null) {
             return h.getEncoding();
         }
 

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/main/org/apache/tools/zip/ZipEntry.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/zip/ZipEntry.java b/src/main/org/apache/tools/zip/ZipEntry.java
index eac5f63..4d619d3 100644
--- a/src/main/org/apache/tools/zip/ZipEntry.java
+++ b/src/main/org/apache/tools/zip/ZipEntry.java
@@ -110,8 +110,7 @@ public class ZipEntry extends java.util.zip.ZipEntry implements Cloneable {
         final byte[] extra = entry.getExtra();
         if (extra != null) {
             setExtraFields(ExtraFieldUtils.parse(extra, true,
-                                                 ExtraFieldUtils
-                                                 .UnparseableExtraField.READ));
+                    ExtraFieldUtils.UnparseableExtraField.READ));
         } else {
             // initializes extra data to an empty byte array
             setExtra();
@@ -137,8 +136,7 @@ public class ZipEntry extends java.util.zip.ZipEntry implements Cloneable {
         setExtraFields(getAllExtraFieldsNoCopy());
         setPlatform(entry.getPlatform());
         GeneralPurposeBit other = entry.getGeneralPurposeBit();
-        setGeneralPurposeBit(other == null ? null :
-                             (GeneralPurposeBit) other.clone());
+        setGeneralPurposeBit(other == null ? null : (GeneralPurposeBit) other.clone());
     }
 
     /**
@@ -161,9 +159,8 @@ public class ZipEntry extends java.util.zip.ZipEntry implements Cloneable {
      * @param entryName String
      */
     public ZipEntry(final File inputFile, final String entryName) {
-        this(inputFile.isDirectory() && !entryName.endsWith("/") ?
-             entryName + "/" : entryName);
-        if (inputFile.isFile()){
+        this(inputFile.isDirectory() && !entryName.endsWith("/") ? entryName + "/" : entryName);
+        if (inputFile.isFile()) {
             setSize(inputFile.length());
         }
         setTime(inputFile.lastModified());
@@ -205,8 +202,8 @@ public class ZipEntry extends java.util.zip.ZipEntry implements Cloneable {
     @Override
     public void setMethod(final int method) {
         if (method < 0) {
-            throw new IllegalArgumentException(
-                    "ZIP compression method can not be negative: " + method);
+            throw new IllegalArgumentException("ZIP compression method can not be negative: "
+                    + method);
         }
         this.method = method;
     }
@@ -276,8 +273,8 @@ public class ZipEntry extends java.util.zip.ZipEntry implements Cloneable {
      * @since Ant 1.6
      */
     public int getUnixMode() {
-        return platform != PLATFORM_UNIX ? 0 :
-            (int) ((getExternalAttributes() >> SHORT_SHIFT) & SHORT_MASK);
+        return platform != PLATFORM_UNIX ? 0
+                : (int) ((getExternalAttributes() >> SHORT_SHIFT) & SHORT_MASK);
     }
 
     /**
@@ -315,7 +312,7 @@ public class ZipEntry extends java.util.zip.ZipEntry implements Cloneable {
             if (field instanceof UnparseableExtraFieldData) {
                 unparseableExtra = (UnparseableExtraFieldData) field;
             } else {
-                newFields.add( field);
+                newFields.add(field);
             }
         }
         extraFields = newFields.toArray(new ZipExtraField[newFields.size()]);
@@ -341,9 +338,7 @@ public class ZipEntry extends java.util.zip.ZipEntry implements Cloneable {
      * @since 1.1
      */
     public ZipExtraField[] getExtraFields(final boolean includeUnparseable) {
-        return includeUnparseable ?
-                getAllExtraFields() :
-                getParseableExtraFields();
+        return includeUnparseable ? getAllExtraFields() : getParseableExtraFields();
     }
 
     private ZipExtraField[] getParseableExtraFieldsNoCopy() {
@@ -355,36 +350,34 @@ public class ZipEntry extends java.util.zip.ZipEntry implements Cloneable {
 
     private ZipExtraField[] getParseableExtraFields() {
         final ZipExtraField[] parseableExtraFields = getParseableExtraFieldsNoCopy();
-        return (parseableExtraFields == extraFields)
-            ? copyOf(parseableExtraFields) : parseableExtraFields;
+        return (parseableExtraFields == extraFields) ? copyOf(parseableExtraFields)
+                : parseableExtraFields;
     }
 
-    private ZipExtraField[] copyOf(ZipExtraField[] src){
+    private ZipExtraField[] copyOf(ZipExtraField[] src) {
         return copyOf(src, src.length);
     }
 
-    private ZipExtraField[] copyOf(ZipExtraField[] src, int length){
+    private ZipExtraField[] copyOf(ZipExtraField[] src, int length) {
         ZipExtraField[] cpy = new ZipExtraField[length];
         System.arraycopy(src, 0, cpy, 0, Math.min(src.length, length));
         return cpy;
     }
 
     private ZipExtraField[] getMergedFields() {
-        final ZipExtraField[] zipExtraFields =
-            copyOf(extraFields, extraFields.length + 1);
+        final ZipExtraField[] zipExtraFields = copyOf(extraFields, extraFields.length + 1);
         zipExtraFields[extraFields.length] = unparseableExtra;
         return zipExtraFields;
     }
 
     private ZipExtraField[] getUnparseableOnly() {
-        return unparseableExtra == null
-            ? noExtraFields : new ZipExtraField[] { unparseableExtra };
+        return unparseableExtra == null ? noExtraFields : new ZipExtraField[] {unparseableExtra};
     }
 
     private ZipExtraField[] getAllExtraFields() {
         final ZipExtraField[] allExtraFieldsNoCopy = getAllExtraFieldsNoCopy();
-        return (allExtraFieldsNoCopy == extraFields)
-            ? copyOf(allExtraFieldsNoCopy) : allExtraFieldsNoCopy;
+        return (allExtraFieldsNoCopy == extraFields) ? copyOf(allExtraFieldsNoCopy)
+                : allExtraFieldsNoCopy;
     }
 
     /**
@@ -416,11 +409,10 @@ public class ZipEntry extends java.util.zip.ZipEntry implements Cloneable {
             if (extraFields == null) {
                 extraFields = new ZipExtraField[] {ze};
             } else {
-                if (getExtraField(ze.getHeaderId()) !=  null){
+                if (getExtraField(ze.getHeaderId()) !=  null) {
                     removeExtraField(ze.getHeaderId());
                 }
-                final ZipExtraField[] zipExtraFields =
-                    copyOf(extraFields, extraFields.length + 1);
+                final ZipExtraField[] zipExtraFields = copyOf(extraFields, extraFields.length + 1);
                 zipExtraFields[extraFields.length] = ze;
                 extraFields = zipExtraFields;
             }
@@ -441,14 +433,14 @@ public class ZipEntry extends java.util.zip.ZipEntry implements Cloneable {
         if (ze instanceof UnparseableExtraFieldData) {
             unparseableExtra = (UnparseableExtraFieldData) ze;
         } else {
-            if (getExtraField(ze.getHeaderId()) != null){
+            if (getExtraField(ze.getHeaderId()) != null) {
                 removeExtraField(ze.getHeaderId());
             }
             ZipExtraField[] copy = extraFields;
-            int newLen = extraFields != null ? extraFields.length + 1: 1;
+            int newLen = extraFields != null ? extraFields.length + 1 : 1;
             extraFields = new ZipExtraField[newLen];
             extraFields[0] = ze;
-            if (copy != null){
+            if (copy != null) {
                 System.arraycopy(copy, 0, extraFields, 1, extraFields.length - 1);
             }
         }
@@ -467,7 +459,7 @@ public class ZipEntry extends java.util.zip.ZipEntry implements Cloneable {
         }
         List<ZipExtraField> newResult = new ArrayList<ZipExtraField>();
         for (ZipExtraField extraField : extraFields) {
-            if (!type.equals(extraField.getHeaderId())){
+            if (!type.equals(extraField.getHeaderId())) {
                 newResult.add(extraField);
             }
         }
@@ -528,9 +520,8 @@ public class ZipEntry extends java.util.zip.ZipEntry implements Cloneable {
     @Override
     public void setExtra(final byte[] extra) throws RuntimeException {
         try {
-            final ZipExtraField[] local =
-                ExtraFieldUtils.parse(extra, true,
-                                      ExtraFieldUtils.UnparseableExtraField.READ);
+            final ZipExtraField[] local = ExtraFieldUtils.parse(extra, true,
+                    ExtraFieldUtils.UnparseableExtraField.READ);
             mergeExtraFields(local, true);
         } catch (final ZipException e) {
             // actually this is not be possible as of Ant 1.8.1
@@ -558,9 +549,8 @@ public class ZipEntry extends java.util.zip.ZipEntry implements Cloneable {
      */
     public void setCentralDirectoryExtra(final byte[] b) {
         try {
-            final ZipExtraField[] central =
-                ExtraFieldUtils.parse(b, false,
-                                      ExtraFieldUtils.UnparseableExtraField.READ);
+            final ZipExtraField[] central = ExtraFieldUtils.parse(b, false,
+                    ExtraFieldUtils.UnparseableExtraField.READ);
             mergeExtraFields(central, false);
         } catch (final ZipException e) {
             throw new RuntimeException(e.getMessage(), e); //NOSONAR
@@ -632,8 +622,7 @@ public class ZipEntry extends java.util.zip.ZipEntry implements Cloneable {
      * @param name the name to use
      */
     protected void setName(String name) {
-        if (name != null && getPlatform() == PLATFORM_FAT
-            && name.indexOf("/") == -1) {
+        if (name != null && getPlatform() == PLATFORM_FAT && !name.contains("/")) {
             name = name.replace('\\', '/');
         }
         this.name = name;
@@ -813,10 +802,8 @@ public class ZipEntry extends java.util.zip.ZipEntry implements Cloneable {
             && getSize() == other.getSize()
             && getCrc() == other.getCrc()
             && getCompressedSize() == other.getCompressedSize()
-            && Arrays.equals(getCentralDirectoryExtra(),
-                             other.getCentralDirectoryExtra())
-            && Arrays.equals(getLocalFileDataExtra(),
-                             other.getLocalFileDataExtra())
+            && Arrays.equals(getCentralDirectoryExtra(), other.getCentralDirectoryExtra())
+            && Arrays.equals(getLocalFileDataExtra(), other.getLocalFileDataExtra())
             && gpb.equals(other.gpb);
     }
 }

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/main/org/apache/tools/zip/ZipLong.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/zip/ZipLong.java b/src/main/org/apache/tools/zip/ZipLong.java
index 6180823..5932f84 100644
--- a/src/main/org/apache/tools/zip/ZipLong.java
+++ b/src/main/org/apache/tools/zip/ZipLong.java
@@ -75,7 +75,7 @@ public final class ZipLong implements Cloneable {
      * @param bytes the bytes to store as a ZipLong
      * @since 1.1
      */
-    public ZipLong (byte[] bytes) {
+    public ZipLong(byte[] bytes) {
         this(bytes, 0);
     }
 
@@ -85,7 +85,7 @@ public final class ZipLong implements Cloneable {
      * @param offset the offset to start
      * @since 1.1
      */
-    public ZipLong (byte[] bytes, int offset) {
+    public ZipLong(byte[] bytes, int offset) {
         value = ZipLong.getValue(bytes, offset);
     }
 

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/main/org/apache/tools/zip/ZipOutputStream.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/zip/ZipOutputStream.java b/src/main/org/apache/tools/zip/ZipOutputStream.java
index db934c8..16cff04 100644
--- a/src/main/org/apache/tools/zip/ZipOutputStream.java
+++ b/src/main/org/apache/tools/zip/ZipOutputStream.java
@@ -519,7 +519,7 @@ public class ZipOutputStream extends FilterOutputStream {
         int count = 0;
         for (ZipEntry ze : entries) {
             byteArrayOutputStream.write(createCentralFileHeader(ze));
-            if (++count > NUM_PER_WRITE){
+            if (++count > NUM_PER_WRITE) {
                 writeCounted(byteArrayOutputStream.toByteArray());
                 byteArrayOutputStream.reset();
                 count = 0;
@@ -663,7 +663,7 @@ public class ZipOutputStream extends FilterOutputStream {
         return requestedMode == Zip64Mode.Always || isTooLageForZip32(entry1);
     }
 
-    private boolean isTooLageForZip32(ZipEntry zipArchiveEntry){
+    private boolean isTooLageForZip32(ZipEntry zipArchiveEntry) {
         return zipArchiveEntry.getSize() >= ZIP64_MAGIC
             || zipArchiveEntry.getCompressedSize() >= ZIP64_MAGIC;
     }
@@ -941,7 +941,7 @@ public class ZipOutputStream extends FilterOutputStream {
      * @param offset int
      * @param length int
      */
-    private void writeDeflated(byte[]b, int offset, int length)
+    private void writeDeflated(byte[] b, int offset, int length)
         throws IOException {
         if (length > 0 && !def.finished()) {
             entry.bytesRead += length;
@@ -1070,7 +1070,7 @@ public class ZipOutputStream extends FilterOutputStream {
     private byte[] createLocalFileHeader(ZipEntry ze, ByteBuffer name, boolean encodable)  {
         byte[] extra = ze.getLocalFileDataExtra();
         final int nameLen = name.limit() - name.position();
-        int len= LFH_FILENAME_OFFSET + nameLen + extra.length;
+        int len = LFH_FILENAME_OFFSET + nameLen + extra.length;
         byte[] buf = new byte[len];
 
         System.arraycopy(LFH_SIG,  0, buf, LFH_SIG_OFFSET, WORD);
@@ -1099,7 +1099,7 @@ public class ZipOutputStream extends FilterOutputStream {
 
         // compressed length
         // uncompressed length
-        if (hasZip64Extra(entry.entry)){
+        if (hasZip64Extra(entry.entry)) {
             // point to ZIP64 extended information extra field for
             // sizes, may get rewritten once sizes are known if
             // stream is seekable
@@ -1243,7 +1243,7 @@ public class ZipOutputStream extends FilterOutputStream {
         ByteBuffer commentB = getEntryEncoding(ze).encode(comm);
         final int nameLen = name.limit() - name.position();
         final int commentLen = commentB.limit() - commentB.position();
-        int len= CFH_FILENAME_OFFSET + nameLen + extra.length + commentLen;
+        int len = CFH_FILENAME_OFFSET + nameLen + extra.length + commentLen;
         byte[] buf = new byte[len];
 
         System.arraycopy(CFH_SIG,  0, buf, CFH_SIG_OFFSET, WORD);
@@ -1566,9 +1566,8 @@ public class ZipOutputStream extends FilterOutputStream {
         }
         // requires version 2 as we are going to store length info
         // in the data descriptor
-        return (isDeflatedToOutputStream(zipMethod)) ?
-                DATA_DESCRIPTOR_MIN_VERSION :
-                INITIAL_VERSION;
+        return (isDeflatedToOutputStream(zipMethod))
+            ? DATA_DESCRIPTOR_MIN_VERSION : INITIAL_VERSION;
     }
 
     private boolean isDeflatedToOutputStream(int zipMethod) {

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/main/org/apache/tools/zip/ZipShort.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/zip/ZipShort.java b/src/main/org/apache/tools/zip/ZipShort.java
index 2f5482f..ccbca3d 100644
--- a/src/main/org/apache/tools/zip/ZipShort.java
+++ b/src/main/org/apache/tools/zip/ZipShort.java
@@ -36,7 +36,7 @@ public final class ZipShort implements Cloneable {
      * @param value the int to store as a ZipShort
      * @since 1.1
      */
-    public ZipShort (int value) {
+    public ZipShort(int value) {
         this.value = value;
     }
 
@@ -45,7 +45,7 @@ public final class ZipShort implements Cloneable {
      * @param bytes the bytes to store as a ZipShort
      * @since 1.1
      */
-    public ZipShort (byte[] bytes) {
+    public ZipShort(byte[] bytes) {
         this(bytes, 0);
     }
 
@@ -55,7 +55,7 @@ public final class ZipShort implements Cloneable {
      * @param offset the offset to start
      * @since 1.1
      */
-    public ZipShort (byte[] bytes, int offset) {
+    public ZipShort(byte[] bytes, int offset) {
         value = ZipShort.getValue(bytes, offset);
     }
 
@@ -80,7 +80,7 @@ public final class ZipShort implements Cloneable {
      */
     public static void putShort(int value, byte[] buf, int offset) {
         buf[offset] = (byte) (value & BYTE_MASK);
-        buf[offset+1] = (byte) ((value & BYTE_1_MASK) >> BYTE_1_SHIFT);
+        buf[offset + 1] = (byte) ((value & BYTE_1_MASK) >> BYTE_1_SHIFT);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/main/org/apache/tools/zip/ZipUtil.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/zip/ZipUtil.java b/src/main/org/apache/tools/zip/ZipUtil.java
index 9926a29..ff35ca4 100644
--- a/src/main/org/apache/tools/zip/ZipUtil.java
+++ b/src/main/org/apache/tools/zip/ZipUtil.java
@@ -76,7 +76,7 @@ public abstract class ZipUtil {
 
         int year = c.get(Calendar.YEAR);
         if (year < 1980) {
-            System.arraycopy(DOS_TIME_MIN, 0, buf, offset, DOS_TIME_MIN.length);// stop callers from changing the array
+            System.arraycopy(DOS_TIME_MIN, 0, buf, offset, DOS_TIME_MIN.length); // stop callers from changing the array
             return;
         }
         int month = c.get(Calendar.MONTH) + 1;

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/tests/junit/org/apache/tools/ant/AntClassLoaderTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/AntClassLoaderTest.java b/src/tests/junit/org/apache/tools/ant/AntClassLoaderTest.java
index bddf729..a016d49 100644
--- a/src/tests/junit/org/apache/tools/ant/AntClassLoaderTest.java
+++ b/src/tests/junit/org/apache/tools/ant/AntClassLoaderTest.java
@@ -70,7 +70,7 @@ public class AntClassLoaderTest {
         String extjarstring = buildRule.getProject().getProperty("ext.jar");
         Path myPath = new Path(buildRule.getProject());
         myPath.setLocation(new File(mainjarstring));
-        buildRule.getProject().setUserProperty("build.sysclasspath","ignore");
+        buildRule.getProject().setUserProperty("build.sysclasspath", "ignore");
         loader = buildRule.getProject().createClassLoader(myPath);
         String path = loader.getClasspath();
         assertEquals(mainjarstring + File.pathSeparator + extjarstring, path);
@@ -82,7 +82,7 @@ public class AntClassLoaderTest {
         String extjarstring = buildRule.getProject().getProperty("ext.jar.nonascii");
         Path myPath = new Path(buildRule.getProject());
         myPath.setLocation(new File(mainjarstring));
-        buildRule.getProject().setUserProperty("build.sysclasspath","ignore");
+        buildRule.getProject().setUserProperty("build.sysclasspath", "ignore");
         loader = buildRule.getProject().createClassLoader(myPath);
         String path = loader.getClasspath();
         assertEquals(mainjarstring + File.pathSeparator + extjarstring, path);
@@ -129,7 +129,7 @@ public class AntClassLoaderTest {
         buildRule.executeTarget("prepareGetPackageTest");
         Path myPath = new Path(buildRule.getProject());
         myPath.setLocation(new File(buildRule.getProject().getProperty("test.jar")));
-        buildRule.getProject().setUserProperty("build.sysclasspath","ignore");
+        buildRule.getProject().setUserProperty("build.sysclasspath", "ignore");
         loader = buildRule.getProject().createClassLoader(myPath);
         assertNotNull("should find class", loader.findClass("org.example.Foo"));
         assertNotNull("should find package",
@@ -142,7 +142,7 @@ public class AntClassLoaderTest {
         Path myPath = new Path(buildRule.getProject());
         File testJar = new File(buildRule.getProject().getProperty("test.jar"));
         myPath.setLocation(testJar);
-        buildRule.getProject().setUserProperty("build.sysclasspath","ignore");
+        buildRule.getProject().setUserProperty("build.sysclasspath", "ignore");
         loader = buildRule.getProject().createClassLoader(myPath);
         Class<?> foo = loader.findClass("org.example.Foo");
         URL codeSourceLocation =
@@ -158,7 +158,7 @@ public class AntClassLoaderTest {
 
         Path myPath = new Path(buildRule.getProject());
         myPath.setLocation(jar);
-        buildRule.getProject().setUserProperty("build.sysclasspath","ignore");
+        buildRule.getProject().setUserProperty("build.sysclasspath", "ignore");
         loader = buildRule.getProject().createClassLoader(myPath);
         Class<?> foo = loader.findClass("org.example.Foo");
 
@@ -182,7 +182,7 @@ public class AntClassLoaderTest {
 
         Path myPath = new Path(buildRule.getProject());
         myPath.setLocation(jar);
-        buildRule.getProject().setUserProperty("build.sysclasspath","ignore");
+        buildRule.getProject().setUserProperty("build.sysclasspath", "ignore");
         loader = buildRule.getProject().createClassLoader(myPath);
         PrintStream sysErr = System.err;
         try {

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/tests/junit/org/apache/tools/ant/BuildFileRule.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/BuildFileRule.java b/src/tests/junit/org/apache/tools/ant/BuildFileRule.java
index 2611cb2..c5a71c7 100644
--- a/src/tests/junit/org/apache/tools/ant/BuildFileRule.java
+++ b/src/tests/junit/org/apache/tools/ant/BuildFileRule.java
@@ -222,7 +222,7 @@ public class BuildFileRule extends ExternalResource {
         }
 
         public void write(int b) {
-            buffer.append((char)b);
+            buffer.append((char) b);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/tests/junit/org/apache/tools/ant/BuildFileTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/BuildFileTest.java b/src/tests/junit/org/apache/tools/ant/BuildFileTest.java
index 681cef3..e821bae 100644
--- a/src/tests/junit/org/apache/tools/ant/BuildFileTest.java
+++ b/src/tests/junit/org/apache/tools/ant/BuildFileTest.java
@@ -400,7 +400,7 @@ public abstract class BuildFileTest extends TestCase {
     public void expectSpecificBuildException(String target, String cause, String msg) {
         try {
             executeTarget(target);
-        } catch (org.apache.tools.ant.BuildException ex) {
+        } catch (BuildException ex) {
             buildException = ex;
             if ((null != msg) && (!ex.getMessage().equals(msg))) {
                 fail("Should throw BuildException because '" + cause
@@ -453,7 +453,7 @@ public abstract class BuildFileTest extends TestCase {
      */
     public void assertPropertyEquals(String property, String value) {
         String result = project.getProperty(property);
-        assertEquals("property " + property,value,result);
+        assertEquals("property " + property, value, result);
     }
 
     /**
@@ -461,7 +461,7 @@ public abstract class BuildFileTest extends TestCase {
      *
      * @param property property name
      */
-    public  void assertPropertySet(String property) {
+    public void assertPropertySet(String property) {
         assertPropertyEquals(property, "true");
     }
 
@@ -484,7 +484,7 @@ public abstract class BuildFileTest extends TestCase {
      * @param target build file target
      * @param property property name
      */
-    public  void expectPropertySet(String target, String property) {
+    public void expectPropertySet(String target, String property) {
         expectPropertySet(target, property, "true");
     }
 
@@ -494,7 +494,7 @@ public abstract class BuildFileTest extends TestCase {
      * @param target build file target
      * @param property property name
      */
-    public  void expectPropertyUnset(String target, String property) {
+    public void expectPropertyUnset(String target, String property) {
         expectPropertySet(target, property, null);
     }
 
@@ -523,7 +523,7 @@ public abstract class BuildFileTest extends TestCase {
         }
 
         public void write(int b) {
-            buffer.append((char)b);
+            buffer.append((char) b);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/tests/junit/org/apache/tools/ant/DirectoryScannerTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/DirectoryScannerTest.java b/src/tests/junit/org/apache/tools/ant/DirectoryScannerTest.java
index 3691d94..819d4e5 100644
--- a/src/tests/junit/org/apache/tools/ant/DirectoryScannerTest.java
+++ b/src/tests/junit/org/apache/tools/ant/DirectoryScannerTest.java
@@ -104,7 +104,7 @@ public class DirectoryScannerTest {
         ds.setIncludes(new String[] {"alpha/beta/gamma/GAMMA.XML"});
         ds.scan();
         compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"},
-            new String[] {});
+                new String[] {});
     }
 
     @Test
@@ -114,9 +114,8 @@ public class DirectoryScannerTest {
         ds.setIncludes(new String[] {"ALPHA/"});
         ds.setCaseSensitive(false);
         ds.scan();
-        compareFiles(ds, new String[] {"alpha/beta/beta.xml",
-                                       "alpha/beta/gamma/gamma.xml"},
-                     new String[] {"alpha", "alpha/beta", "alpha/beta/gamma"});
+        compareFiles(ds, new String[] {"alpha/beta/beta.xml", "alpha/beta/gamma/gamma.xml"},
+                new String[] {"alpha", "alpha/beta", "alpha/beta/gamma"});
     }
 
     @Test
@@ -130,14 +129,13 @@ public class DirectoryScannerTest {
         ds.setIncludes(new String[] {"alpha/beta/gamma/"});
         ds.scan();
         compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"},
-                     new String[] {"alpha/beta/gamma"});
+                new String[] {"alpha/beta/gamma"});
     }
 
     @Test
     public void testProhibitSymlinks() {
         assumeTrue("Current system does not support Symlinks", supportsSymlinks);
 
-
         buildRule.getProject().executeTarget("symlink-setup");
         DirectoryScanner ds = new DirectoryScanner();
         ds.setBasedir(new File(buildRule.getProject().getProperty("output")));
@@ -150,9 +148,9 @@ public class DirectoryScannerTest {
     // father and child pattern test
     @Test
     public void testOrderOfIncludePatternsIrrelevant() {
-        String [] expectedFiles = {"alpha/beta/beta.xml",
+        String[] expectedFiles = {"alpha/beta/beta.xml",
                                    "alpha/beta/gamma/gamma.xml"};
-        String [] expectedDirectories = {"alpha/beta", "alpha/beta/gamma" };
+        String[] expectedDirectories = {"alpha/beta", "alpha/beta/gamma" };
         DirectoryScanner ds = new DirectoryScanner();
         ds.setBasedir(new File(buildRule.getProject().getProperty("output")));
         ds.setIncludes(new String[] {"alpha/be?a/**", "alpha/beta/gamma/"});
@@ -172,9 +170,8 @@ public class DirectoryScannerTest {
         ds.setBasedir(new File(buildRule.getProject().getProperty("output")));
         ds.setIncludes(new String[] {"alpha/", "ALPHA/"});
         ds.scan();
-        compareFiles(ds, new String[] {"alpha/beta/beta.xml",
-                                       "alpha/beta/gamma/gamma.xml"},
-                     new String[] {"alpha", "alpha/beta", "alpha/beta/gamma"});
+        compareFiles(ds, new String[] {"alpha/beta/beta.xml", "alpha/beta/gamma/gamma.xml"},
+                new String[] {"alpha", "alpha/beta", "alpha/beta/gamma"});
     }
 
     @Test
@@ -184,36 +181,27 @@ public class DirectoryScannerTest {
         ds.setIncludes(new String[] {"alpha/", "ALPHA/"});
         ds.setCaseSensitive(false);
         ds.scan();
-        compareFiles(ds, new String[] {"alpha/beta/beta.xml",
-                                       "alpha/beta/gamma/gamma.xml"},
-                     new String[] {"alpha", "alpha/beta", "alpha/beta/gamma"});
+        compareFiles(ds, new String[] {"alpha/beta/beta.xml", "alpha/beta/gamma/gamma.xml"},
+                new String[] {"alpha", "alpha/beta", "alpha/beta/gamma"});
     }
 
     @Test
     public void testFullpathDiffersInCaseScanningSensitive() {
         DirectoryScanner ds = new DirectoryScanner();
         ds.setBasedir(new File(buildRule.getProject().getProperty("output")));
-        ds.setIncludes(new String[] {
-            "alpha/beta/gamma/gamma.xml",
-            "alpha/beta/gamma/GAMMA.XML"
-        });
+        ds.setIncludes(new String[] {"alpha/beta/gamma/gamma.xml", "alpha/beta/gamma/GAMMA.XML"});
         ds.scan();
-        compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"},
-                     new String[] {});
+        compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"}, new String[] {});
     }
 
     @Test
     public void testFullpathDiffersInCaseScanningInsensitive() {
         DirectoryScanner ds = new DirectoryScanner();
         ds.setBasedir(new File(buildRule.getProject().getProperty("output")));
-        ds.setIncludes(new String[] {
-            "alpha/beta/gamma/gamma.xml",
-            "alpha/beta/gamma/GAMMA.XML"
-        });
+        ds.setIncludes(new String[] {"alpha/beta/gamma/gamma.xml", "alpha/beta/gamma/GAMMA.XML"});
         ds.setCaseSensitive(false);
         ds.scan();
-        compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"},
-                     new String[] {});
+        compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"}, new String[] {});
     }
 
     @Test
@@ -222,9 +210,8 @@ public class DirectoryScannerTest {
         ds.setBasedir(new File(buildRule.getProject().getProperty("output")));
         ds.setIncludes(new String[] {"alpha/", "ALPHA/beta/"});
         ds.scan();
-        compareFiles(ds, new String[] {"alpha/beta/beta.xml",
-                                       "alpha/beta/gamma/gamma.xml"},
-                     new String[] {"alpha", "alpha/beta", "alpha/beta/gamma"});
+        compareFiles(ds, new String[] {"alpha/beta/beta.xml", "alpha/beta/gamma/gamma.xml"},
+                new String[] {"alpha", "alpha/beta", "alpha/beta/gamma"});
     }
 
     @Test
@@ -234,9 +221,8 @@ public class DirectoryScannerTest {
         ds.setIncludes(new String[] {"alpha/", "ALPHA/beta/"});
         ds.setCaseSensitive(false);
         ds.scan();
-        compareFiles(ds, new String[] {"alpha/beta/beta.xml",
-                                       "alpha/beta/gamma/gamma.xml"},
-                     new String[] {"alpha", "alpha/beta", "alpha/beta/gamma"});
+        compareFiles(ds, new String[] {"alpha/beta/beta.xml", "alpha/beta/gamma/gamma.xml"},
+                new String[] {"alpha", "alpha/beta", "alpha/beta/gamma"});
     }
 
     /**
@@ -254,13 +240,10 @@ public class DirectoryScannerTest {
 
             try {
                 // add conditions and more commands as soon as the need arises
-                String[] command = new String[] {
-                    "ln", "-s", "ant", linkFile.getAbsolutePath()
-                };
+                String[] command = new String[] {"ln", "-s", "ant", linkFile.getAbsolutePath()};
                 Process process = Runtime.getRuntime().exec(command);
                 assertEquals("0 return code expected for external process", 0, process.waitFor());
 
-
                 File dir = new File(System.getProperty("root"), "src/main/org/apache/tools");
 
                 DirectoryScanner ds = new DirectoryScanner();
@@ -280,9 +263,7 @@ public class DirectoryScannerTest {
                 for (String included : includeds) {
                     if (included.equals("zip")) {
                         haveZipPackage = true;
-                    } else if (included.equals("ThisIsALink"
-                            + File.separator
-                            + "taskdefs")) {
+                    } else if (included.equals("ThisIsALink" + File.separator + "taskdefs")) {
                         haveTaskdefsPackage = true;
                     }
                 }
@@ -306,9 +287,7 @@ public class DirectoryScannerTest {
                 for (String included : includeds) {
                     if (included.equals("zip")) {
                         haveZipPackage = true;
-                    } else if (included.equals("ThisIsALink"
-                            + File.separator
-                            + "taskdefs")) {
+                    } else if (included.equals("ThisIsALink" + File.separator + "taskdefs")) {
                         haveTaskdefsPackage = true;
                     }
                 }
@@ -329,65 +308,44 @@ public class DirectoryScannerTest {
     public void testExcludeOneFile() {
         DirectoryScanner ds = new DirectoryScanner();
         ds.setBasedir(new File(buildRule.getProject().getProperty("output")));
-        ds.setIncludes(new String[] {
-            "**/*.xml"
-        });
-        ds.setExcludes(new String[] {
-            "alpha/beta/b*xml"
-        });
+        ds.setIncludes(new String[] {"**/*.xml"});
+        ds.setExcludes(new String[] {"alpha/beta/b*xml"});
         ds.scan();
         compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"},
-                     new String[] {});
+                new String[] {});
     }
 
     @Test
     public void testExcludeHasPrecedence() {
         DirectoryScanner ds = new DirectoryScanner();
         ds.setBasedir(new File(buildRule.getProject().getProperty("output")));
-        ds.setIncludes(new String[] {
-            "alpha/**"
-        });
-        ds.setExcludes(new String[] {
-            "alpha/**"
-        });
+        ds.setIncludes(new String[] {"alpha/**"});
+        ds.setExcludes(new String[] {"alpha/**"});
         ds.scan();
         compareFiles(ds, new String[] {},
-                     new String[] {});
-
+                new String[] {});
     }
 
     @Test
     public void testAlternateIncludeExclude() {
         DirectoryScanner ds = new DirectoryScanner();
         ds.setBasedir(new File(buildRule.getProject().getProperty("output")));
-        ds.setIncludes(new String[] {
-            "alpha/**",
-            "alpha/beta/gamma/**"
-        });
-        ds.setExcludes(new String[] {
-            "alpha/beta/**"
-        });
+        ds.setIncludes(new String[] {"alpha/**", "alpha/beta/gamma/**"});
+        ds.setExcludes(new String[] {"alpha/beta/**"});
         ds.scan();
         compareFiles(ds, new String[] {},
-                     new String[] {"alpha"});
-
+                new String[] {"alpha"});
     }
 
     @Test
     public void testAlternateExcludeInclude() {
         DirectoryScanner ds = new DirectoryScanner();
         ds.setBasedir(new File(buildRule.getProject().getProperty("output")));
-        ds.setExcludes(new String[] {
-            "alpha/**",
-            "alpha/beta/gamma/**"
-        });
-        ds.setIncludes(new String[] {
-            "alpha/beta/**"
-        });
+        ds.setExcludes(new String[] {"alpha/**", "alpha/beta/gamma/**"});
+        ds.setIncludes(new String[] {"alpha/beta/**"});
         ds.scan();
         compareFiles(ds, new String[] {},
-                     new String[] {});
-
+                new String[] {});
     }
 
     /**
@@ -424,9 +382,9 @@ public class DirectoryScannerTest {
         // a sysproperty with name tests.and.ant.share.classloader and value
         // ${tests.and.ant.share.classloader} will be set
         // we are trying to catch this here.
-        assumeFalse("cannot execute testIsExcludedDirectoryScanned when tests are forked, " +
-                "package private method called", shareclassloader == null
-                || (shareclassloader != null && shareclassloader.indexOf("${") == 0));
+        assumeFalse("cannot execute testIsExcludedDirectoryScanned when tests are forked, "
+                + "package private method called", shareclassloader == null
+                        || shareclassloader.indexOf("${") == 0);
         buildRule.getProject().executeTarget("children-of-excluded-dir-setup");
         DirectoryScanner ds = new DirectoryScanner();
         ds.setBasedir(new File(buildRule.getProject().getProperty("output")));
@@ -448,13 +406,14 @@ public class DirectoryScannerTest {
                 File.separatorChar, '/');
         ds.setIncludes(new String[] {tmpdir + "/**/*"});
         ds.scan();
-        compareFiles(ds, new String[] {tmpdir + "/alpha/beta/beta.xml",
-                                       tmpdir + "/alpha/beta/gamma/gamma.xml",
-                                       tmpdir + "/delta/delta.xml"},
-                     new String[] {tmpdir + "/alpha",
-                                   tmpdir + "/alpha/beta",
-                                   tmpdir + "/alpha/beta/gamma",
-                                   tmpdir + "/delta"});
+        compareFiles(ds,
+                new String[] {tmpdir + "/alpha/beta/beta.xml",
+                        tmpdir + "/alpha/beta/gamma/gamma.xml",
+                        tmpdir + "/delta/delta.xml"},
+                new String[] {tmpdir + "/alpha",
+                        tmpdir + "/alpha/beta",
+                        tmpdir + "/alpha/beta/gamma",
+                        tmpdir + "/delta"});
     }
 
     @Test
@@ -473,14 +432,14 @@ public class DirectoryScannerTest {
         String tmpdir = buildRule.getProject().getProperty("output").replace(
                 File.separatorChar, '/');
         ds.setIncludes(new String[] {tmpdir + "/**/*"});
-        ds.setExcludes(new String[] {"**/alpha",
-                                     "**/delta/*"});
+        ds.setExcludes(new String[] {"**/alpha", "**/delta/*"});
         ds.scan();
-        compareFiles(ds, new String[] {tmpdir + "/alpha/beta/beta.xml",
-                                       tmpdir + "/alpha/beta/gamma/gamma.xml"},
-                     new String[] {tmpdir + "/alpha/beta",
-                                   tmpdir + "/alpha/beta/gamma",
-                                   tmpdir + "/delta"});
+        compareFiles(ds,
+                new String[] {tmpdir + "/alpha/beta/beta.xml",
+                        tmpdir + "/alpha/beta/gamma/gamma.xml"},
+                new String[] {tmpdir + "/alpha/beta",
+                        tmpdir + "/alpha/beta/gamma",
+                        tmpdir + "/delta"});
     }
 
     @Test
@@ -489,19 +448,20 @@ public class DirectoryScannerTest {
         DirectoryScanner ds = new DirectoryScanner();
         String tmpdir = buildRule.getProject().getProperty("output").replace(
                 File.separatorChar, '/');
-        ds.setIncludes(new String[] {tmpdir + "/alpha/beta/**/*",
-                                     tmpdir + "/delta/*"});
+        ds.setIncludes(new String[] {tmpdir + "/alpha/beta/**/*", tmpdir + "/delta/*"});
         ds.setExcludes(new String[] {"**/beta.xml"});
         ds.scan();
-        compareFiles(ds, new String[] {tmpdir + "/alpha/beta/gamma/gamma.xml",
-                                       tmpdir + "/delta/delta.xml"},
-                     new String[] {tmpdir + "/alpha/beta/gamma"});
+        compareFiles(ds,
+                new String[] {tmpdir + "/alpha/beta/gamma/gamma.xml",
+                        tmpdir + "/delta/delta.xml"},
+                new String[] {tmpdir + "/alpha/beta/gamma"});
     }
 
     @Test
     public void testAbsolute5() {
         //testing drive letter search from root:
-        assumeTrue("Can't use drive letters on non DOS or Netware systems", (Os.isFamily("dos") || Os.isFamily("netware")));
+        assumeTrue("Can't use drive letters on non DOS or Netware systems",
+                Os.isFamily("dos") || Os.isFamily("netware"));
         DirectoryScanner ds = new DirectoryScanner();
         String pattern = new File(File.separator).getAbsolutePath().toUpperCase() + "*";
         ds.setIncludes(new String[] {pattern});
@@ -526,8 +486,7 @@ public class DirectoryScannerTest {
         }
         TreeSet<String> directories = new TreeSet<String>();
         for (String includedDirectory : includedDirectories) {
-            directories.add(includedDirectory
-                    .replace(File.separatorChar, '/'));
+            directories.add(includedDirectory.replace(File.separatorChar, '/'));
         }
 
         String currentfile;
@@ -556,19 +515,16 @@ public class DirectoryScannerTest {
         ds.scan();
         List<String> dirs = Arrays.asList(ds.getExcludedDirectories());
         assertEquals(2, dirs.size());
-        assertTrue("beta is excluded",
-                   dirs.contains("alpha/beta".replace('/', File.separatorChar)));
-        assertTrue("gamma is excluded",
-                   dirs.contains("alpha/beta/gamma".replace('/',
-                                                            File.separatorChar)));
+        assertTrue("beta is excluded", dirs.contains("alpha/beta"
+                .replace('/', File.separatorChar)));
+        assertTrue("gamma is excluded", dirs.contains("alpha/beta/gamma"
+                .replace('/', File.separatorChar)));
         List<String> files = Arrays.asList(ds.getExcludedFiles());
         assertEquals(2, files.size());
-        assertTrue("beta.xml is excluded",
-                   files.contains("alpha/beta/beta.xml"
-                                  .replace('/', File.separatorChar)));
-        assertTrue("gamma.xml is excluded",
-                   files.contains("alpha/beta/gamma/gamma.xml"
-                                  .replace('/', File.separatorChar)));
+        assertTrue("beta.xml is excluded", files.contains("alpha/beta/beta.xml"
+                .replace('/', File.separatorChar)));
+        assertTrue("gamma.xml is excluded", files.contains("alpha/beta/gamma/gamma.xml"
+                .replace('/', File.separatorChar)));
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/tests/junit/org/apache/tools/ant/FileUtilities.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/FileUtilities.java b/src/tests/junit/org/apache/tools/ant/FileUtilities.java
index 79b5716..321d8d4 100644
--- a/src/tests/junit/org/apache/tools/ant/FileUtilities.java
+++ b/src/tests/junit/org/apache/tools/ant/FileUtilities.java
@@ -70,7 +70,7 @@ public class FileUtilities {
             return;
         }
 
-        assumeTrue(file.setLastModified(file.lastModified() - (seconds * 1000)));
+        assumeTrue(file.setLastModified(file.lastModified() - seconds * 1000));
 
         if (file.isDirectory()) {
             File[] children = file.listFiles();

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/tests/junit/org/apache/tools/ant/ImmutableTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/ImmutableTest.java b/src/tests/junit/org/apache/tools/ant/ImmutableTest.java
index 933bd28..eb8c4cc 100644
--- a/src/tests/junit/org/apache/tools/ant/ImmutableTest.java
+++ b/src/tests/junit/org/apache/tools/ant/ImmutableTest.java
@@ -41,7 +41,7 @@ public class ImmutableTest {
     @Test
     public void test1() {
         buildRule.executeTarget("test1");
-        assertEquals("override",buildRule.getProject().getProperty("test"));
+        assertEquals("override", buildRule.getProject().getProperty("test"));
     }
 
     // ensure <tstamp>'s new prefix attribute is working

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/tests/junit/org/apache/tools/ant/IntrospectionHelperTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/IntrospectionHelperTest.java b/src/tests/junit/org/apache/tools/ant/IntrospectionHelperTest.java
index 33782e0..3413e60 100644
--- a/src/tests/junit/org/apache/tools/ant/IntrospectionHelperTest.java
+++ b/src/tests/junit/org/apache/tools/ant/IntrospectionHelperTest.java
@@ -554,11 +554,11 @@ public class IntrospectionHelperTest {
         assertAttrMethod("sixteen", "setSixteen", Character.class,
                          new Character('a'), new Character('b'));
         assertAttrMethod("seventeen", "setSeventeen", Byte.TYPE,
-                         new Byte((byte)17), new Byte((byte)10));
+                         new Byte((byte) 17), new Byte((byte) 10));
         assertAttrMethod("eightteen", "setEightteen", Short.TYPE,
-                         new Short((short)18), new Short((short)10));
+                         new Short((short) 18), new Short((short) 10));
         assertAttrMethod("nineteen", "setNineteen", Double.TYPE,
-                         new Double(19), new Double((short)10));
+                         new Double(19), new Double((short) 10));
         assertAttrMethod("twenty", "setTwenty", Path.class,
                          new File(projectBasedir + 20).toPath(), Paths.get("toto"));
 

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/tests/junit/org/apache/tools/ant/PropertyExpansionTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/PropertyExpansionTest.java b/src/tests/junit/org/apache/tools/ant/PropertyExpansionTest.java
index 601391e..c943d3e 100644
--- a/src/tests/junit/org/apache/tools/ant/PropertyExpansionTest.java
+++ b/src/tests/junit/org/apache/tools/ant/PropertyExpansionTest.java
@@ -47,17 +47,17 @@ public class PropertyExpansionTest {
      */
     @Test
     public void testPropertyExpansion() {
-        assertExpandsTo("","");
-        assertExpandsTo("$","$");
-        assertExpandsTo("$$-","$-");
-        assertExpandsTo("$$","$");
-        buildRule.getProject().setProperty("expanded","EXPANDED");
-        assertExpandsTo("a${expanded}b","aEXPANDEDb");
-        assertExpandsTo("${expanded}${expanded}","EXPANDEDEXPANDED");
-        assertExpandsTo("$$$","$$");
-        assertExpandsTo("$$$$-","$$-");
-        assertExpandsTo("","");
-        assertExpandsTo("Class$$subclass","Class$subclass");
+        assertExpandsTo("", "");
+        assertExpandsTo("$", "$");
+        assertExpandsTo("$$-", "$-");
+        assertExpandsTo("$$", "$");
+        buildRule.getProject().setProperty("expanded", "EXPANDED");
+        assertExpandsTo("a${expanded}b", "aEXPANDEDb");
+        assertExpandsTo("${expanded}${expanded}", "EXPANDEDEXPANDED");
+        assertExpandsTo("$$$", "$$");
+        assertExpandsTo("$$$$-", "$$-");
+        assertExpandsTo("", "");
+        assertExpandsTo("Class$$subclass", "Class$subclass");
     }
 
     /**
@@ -65,13 +65,13 @@ public class PropertyExpansionTest {
      */
     @Test
     public void testDollarPassthru() {
-        assertExpandsTo("$-","$-");
-        assertExpandsTo("Class$subclass","Class$subclass");
-        assertExpandsTo("$$$-","$$-");
-        assertExpandsTo("$$$$$","$$$");
-        assertExpandsTo("${unassigned.property}","${unassigned.property}");
-        assertExpandsTo("a$b","a$b");
-        assertExpandsTo("$}}","$}}");
+        assertExpandsTo("$-", "$-");
+        assertExpandsTo("Class$subclass", "Class$subclass");
+        assertExpandsTo("$$$-", "$$-");
+        assertExpandsTo("$$$$$", "$$$");
+        assertExpandsTo("${unassigned.property}", "${unassigned.property}");
+        assertExpandsTo("a$b", "a$b");
+        assertExpandsTo("$}}", "$}}");
     }
 
 
@@ -81,10 +81,10 @@ public class PropertyExpansionTest {
     @Test
     @Ignore("Previously disabled through naming convention")
     public void oldtestQuirkyLegacyBehavior() {
-        assertExpandsTo("Class$subclass","Classsubclass");
-        assertExpandsTo("$$$-","$-");
-        assertExpandsTo("a$b","ab");
-        assertExpandsTo("$}}","}}");
+        assertExpandsTo("Class$subclass", "Classsubclass");
+        assertExpandsTo("$$$-", "$-");
+        assertExpandsTo("a$b", "ab");
+        assertExpandsTo("$}}", "}}");
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/tests/junit/org/apache/tools/ant/filters/TokenFilterTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/filters/TokenFilterTest.java b/src/tests/junit/org/apache/tools/ant/filters/TokenFilterTest.java
index 38835c4..b07abe0 100644
--- a/src/tests/junit/org/apache/tools/ant/filters/TokenFilterTest.java
+++ b/src/tests/junit/org/apache/tools/ant/filters/TokenFilterTest.java
@@ -265,10 +265,10 @@ public class TokenFilterTest {
 
     public static class Capitalize implements TokenFilter.Filter {
         public String filter(String token) {
-            if (token.length() == 0)
+            if (token.length() == 0) {
                 return token;
-            return token.substring(0, 1).toUpperCase() +
-                token.substring(1);
+            }
+            return token.substring(0, 1).toUpperCase() + token.substring(1);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ant/blob/7f1e7628/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java b/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java
index 3184589..b8dffae 100644
--- a/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java
+++ b/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java
@@ -33,8 +33,8 @@ public class LocatorTest {
     private boolean windows;
     private boolean unix;
     private static final String LAUNCHER_JAR = "//morzine/slo/Java/Apache/ant/lib/ant-launcher.jar";
-    private static final String SHARED_JAR_URI = "jar:file:" + LAUNCHER_JAR +
-            "!/org/apache/tools/ant/launch/Launcher.class";
+    private static final String SHARED_JAR_URI = "jar:file:" + LAUNCHER_JAR
+            + "!/org/apache/tools/ant/launch/Launcher.class";
 
 
     @Before


Mime
View raw message