Repository: ant
Updated Branches:
  refs/heads/master 20b616398 -> 845c2c5b3


Checkstyle and simplify assertions

Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/4a242817
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/4a242817
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/4a242817

Branch: refs/heads/master
Commit: 4a242817bda06af545a80804ce431fab0f27b792
Parents: 20b6163
Author: Gintas Grigelionis <gin...@apache.org>
Authored: Wed Apr 4 15:26:32 2018 +0200
Committer: Gintas Grigelionis <gin...@apache.org>
Committed: Wed Apr 4 15:26:32 2018 +0200

----------------------------------------------------------------------
 .../org/apache/tools/ant/taskdefs/EchoXML.java  |  2 +-
 .../taskdefs/launcher/VmsCommandLauncher.java   |  2 +-
 .../org/apache/tools/ant/DispatchTaskTest.java  |  2 +-
 .../tools/ant/IntrospectionHelperTest.java      | 53 +++++++++-----------
 .../junit/org/apache/tools/ant/ProjectTest.java |  3 +-
 .../apache/tools/ant/PropertyExpansionTest.java |  5 +-
 .../tools/ant/taskdefs/AntStructureTest.java    | 18 ++++---
 .../org/apache/tools/ant/taskdefs/AntTest.java  | 12 ++---
 .../apache/tools/ant/taskdefs/ConcatTest.java   |  5 +-
 .../org/apache/tools/ant/taskdefs/CopyTest.java |  3 +-
 .../tools/ant/taskdefs/DefaultExcludesTest.java |  7 ++-
 .../org/apache/tools/ant/taskdefs/EchoTest.java |  2 +-
 .../tools/ant/taskdefs/ExecuteWatchdogTest.java |  5 +-
 .../org/apache/tools/ant/taskdefs/JarTest.java  |  2 +-
 .../apache/tools/ant/taskdefs/ManifestTest.java |  3 +-
 .../org/apache/tools/ant/taskdefs/MoveTest.java | 39 +++++++-------
 .../apache/tools/ant/taskdefs/SQLExecTest.java  |  3 +-
 .../apache/tools/ant/taskdefs/SignJarTest.java  |  2 +-
 .../org/apache/tools/ant/taskdefs/SyncTest.java | 11 ++--
 .../ant/taskdefs/condition/ContainsTest.java    |  3 +-
 .../ant/taskdefs/condition/EqualsTest.java      |  5 +-
 .../ant/taskdefs/condition/IsReferenceTest.java |  2 +-
 .../taskdefs/condition/ParserSupportsTest.java  |  6 +--
 .../tools/ant/taskdefs/email/EmailTaskTest.java |  4 +-
 .../tools/ant/taskdefs/optional/PvcsTest.java   |  2 +-
 .../ant/taskdefs/optional/XmlValidateTest.java  |  4 +-
 .../tools/ant/taskdefs/optional/XsltTest.java   |  2 +-
 .../taskdefs/optional/script/ScriptDefTest.java | 20 ++++----
 .../ant/types/optional/ScriptSelectorTest.java  |  2 +-
 .../tools/ant/util/CollectionUtilsTest.java     | 37 +++++++-------
 .../apache/tools/ant/util/FileUtilsTest.java    |  2 +-
 .../util/LayoutPreservingPropertiesTest.java    | 14 +++---
 .../apache/tools/ant/util/XMLFragmentTest.java  |  4 +-
 .../ant/util/facade/FacadeTaskHelperTest.java   |  2 +-
 34 files changed, 150 insertions(+), 138 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/main/org/apache/tools/ant/taskdefs/EchoXML.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/EchoXML.java 
b/src/main/org/apache/tools/ant/taskdefs/EchoXML.java
index 34baf6b..91b6d8b 100644
--- a/src/main/org/apache/tools/ant/taskdefs/EchoXML.java
+++ b/src/main/org/apache/tools/ant/taskdefs/EchoXML.java
@@ -57,7 +57,7 @@ public class EchoXML extends XMLFragment {
 
     /**
      * Set the namespace policy for the xml file
-     * @param n namespace policy: "ignore," "elementsOnly," or "all"
+     * @param n namespace policy: "ignore", "elementsOnly", or "all"
      * @see org.apache.tools.ant.util.DOMElementWriter.XmlNamespacePolicy
      */
     public void setNamespacePolicy(NamespacePolicy n) {

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/main/org/apache/tools/ant/taskdefs/launcher/VmsCommandLauncher.java
----------------------------------------------------------------------
diff --git 
a/src/main/org/apache/tools/ant/taskdefs/launcher/VmsCommandLauncher.java 
b/src/main/org/apache/tools/ant/taskdefs/launcher/VmsCommandLauncher.java
index fe05b68..695223b 100644
--- a/src/main/org/apache/tools/ant/taskdefs/launcher/VmsCommandLauncher.java
+++ b/src/main/org/apache/tools/ant/taskdefs/launcher/VmsCommandLauncher.java
@@ -125,7 +125,7 @@ public class VmsCommandLauncher extends 
Java13CommandLauncher {
         new Thread(() -> {
             try {
                 p.waitFor();
-            } catch(InterruptedException e) {
+            } catch (InterruptedException e) {
                 // ignore
             }
             FileUtils.delete(f);

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/DispatchTaskTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/DispatchTaskTest.java 
b/src/tests/junit/org/apache/tools/ant/DispatchTaskTest.java
index c682093..dab734f 100644
--- a/src/tests/junit/org/apache/tools/ant/DispatchTaskTest.java
+++ b/src/tests/junit/org/apache/tools/ant/DispatchTaskTest.java
@@ -39,7 +39,7 @@ public class DispatchTaskTest {
         try {
             buildRule.executeTarget("disp");
             fail("BuildException should have been thrown");
-        } catch(BuildException ex) {
+        } catch (BuildException ex) {
             //FIXME the previous method used here ignored the build exception 
- what are we trying to test
         }
     }

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/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 90c8bd7..5a20f38 100644
--- a/src/tests/junit/org/apache/tools/ant/IntrospectionHelperTest.java
+++ b/src/tests/junit/org/apache/tools/ant/IntrospectionHelperTest.java
@@ -259,12 +259,12 @@ public class IntrospectionHelperTest {
     }
 
     private void assertElemMethod(String elemName, String methodName,
-                                  Class returnType, Class methodArg) {
+                                  Class<?> returnType, Class<?> methodArg) {
         Method m = ih.getElementMethod(elemName);
         assertEquals("Method name", methodName, m.getName());
-        Class expectedReturnType = (returnType == null)? Void.TYPE: returnType;
+        Class<?> expectedReturnType = (returnType == null)? Void.TYPE: 
returnType;
         assertEquals("Return type", expectedReturnType, m.getReturnType());
-        Class[] args = m.getParameterTypes();
+        Class<?>[] args = m.getParameterTypes();
         if (methodArg != null) {
             assertEquals("Arg Count", 1, args.length);
             assertEquals("Arg Type", methodArg, args[0]);
@@ -491,14 +491,14 @@ public class IntrospectionHelperTest {
 
     @Test
     public void testGetAttributes() {
-        Map attrMap = getExpectedAttributes();
-        Enumeration e = ih.getAttributes();
+        Map<String, Class<?>> attrMap = getExpectedAttributes();
+        Enumeration<String> e = ih.getAttributes();
         while (e.hasMoreElements()) {
-            String name = (String) e.nextElement();
-            Class expect = (Class) attrMap.get(name);
-            assertNotNull("Support for "+name+" in IntrospectionHelperTest?",
+            String name = e.nextElement();
+            Class<?> expect = attrMap.get(name);
+            assertNotNull("Support for " + name + " in 
IntrospectionHelperTest?",
                           expect);
-            assertEquals("Type of "+name, expect, ih.getAttributeType(name));
+            assertEquals("Type of " + name, expect, ih.getAttributeType(name));
             attrMap.remove(name);
         }
         attrMap.remove("name");
@@ -511,7 +511,7 @@ public class IntrospectionHelperTest {
         Map<String, Class<?>> actualMap = ih.getAttributeMap();
         for (Map.Entry<String, Class<?>> entry : actualMap.entrySet()) {
             String attrName = entry.getKey();
-            Class attrClass = attrMap.get(attrName);
+            Class<?> attrClass = attrMap.get(attrName);
             assertNotNull("Support for " + attrName +
                           " in IntrospectionHelperTest?", attrClass);
             assertEquals("Type of " + attrName, attrClass, entry.getValue());
@@ -568,7 +568,7 @@ public class IntrospectionHelperTest {
     }
 
     private void assertAttrMethod(String attrName, String methodName,
-                                  Class methodArg, Object arg, Object badArg) {
+                                  Class<?> methodArg, Object arg, Object 
badArg) {
         Method m = ih.getAttributeMethod(attrName);
         assertMethod(m, methodName, methodArg, arg, badArg);
     }
@@ -614,14 +614,14 @@ public class IntrospectionHelperTest {
     }
 
     public void setEleven(boolean b) {
-        assertTrue(!b);
+        assertFalse(b);
     }
 
     public void setTwelve(Boolean b) {
-        assertTrue(!b);
+        assertFalse(b);
     }
 
-    public void setThirteen(Class c) {
+    public void setThirteen(Class<?> c) {
         assertEquals(Project.class, c);
     }
 
@@ -664,7 +664,7 @@ public class IntrospectionHelperTest {
 
     @Test
     public void testGetExtensionPoints() {
-        List extensions = ih.getExtensionPoints();
+        List<Method> extensions = ih.getExtensionPoints();
         final int adders = 2;
         assertEquals("extension count", adders, extensions.size());
 
@@ -675,28 +675,23 @@ public class IntrospectionHelperTest {
         // combinatorics are too hard to check.  We really only want
         // to ensure that the more derived Hashtable can be found
         // before Map.
-//        assertExtMethod(extensions.get(0), "add", Number.class,
+//        assertMethod(extensions.get(0), "add", Number.class,
 //                        new Integer(2), new Integer(3));
 
         // addConfigured(Hashtable) should come before addConfigured(Map)
-        assertExtMethod(extensions.get(adders - 2),
+        assertMethod(extensions.get(adders - 2),
                         "addConfigured", Hashtable.class,
                         makeTable("key", "value"), makeTable("1", "2"));
 
-        assertExtMethod(extensions.get(adders - 1), "addConfigured", Map.class,
-                        new HashMap(), makeTable("1", "2"));
-    }
-
-    private void assertExtMethod(Object mo, String methodName, Class methodArg,
-                                 Object arg, Object badArg) {
-        assertMethod((Method) mo, methodName, methodArg, arg, badArg);
+        assertMethod(extensions.get(adders - 1), "addConfigured", Map.class,
+                        new HashMap<String, String>(), makeTable("1", "2"));
     }
 
-    private void assertMethod(Method m, String methodName, Class methodArg,
+    private void assertMethod(Method m, String methodName, Class<?> methodArg,
                               Object arg, Object badArg) {
         assertEquals("Method name", methodName, m.getName());
         assertEquals("Return type", Void.TYPE, m.getReturnType());
-        Class[] args = m.getParameterTypes();
+        Class<?>[] args = m.getParameterTypes();
         assertEquals("Arg Count", 1, args.length);
         assertEquals("Arg Type", methodArg, args[0]);
 
@@ -717,7 +712,7 @@ public class IntrospectionHelperTest {
         }
     }
 
-    public List add(List l) {
+    public List<Object> add(List l) {
         // INVALID extension point
         return null;
     }
@@ -728,11 +723,11 @@ public class IntrospectionHelperTest {
 //        assertEquals(2, n.intValue());
 //    }
 
-    public void add(List l, int i) {
+    public void add(List<Object> l, int i) {
         // INVALID extension point
     }
 
-    public void addConfigured(Map m) {
+    public void addConfigured(Map<Object, Object> m) {
         // Valid extension point
         assertTrue(m.isEmpty());
     }

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/ProjectTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/ProjectTest.java 
b/src/tests/junit/org/apache/tools/ant/ProjectTest.java
index 120c009..15340b6 100644
--- a/src/tests/junit/org/apache/tools/ant/ProjectTest.java
+++ b/src/tests/junit/org/apache/tools/ant/ProjectTest.java
@@ -34,6 +34,7 @@ import org.junit.Test;
 
 import static org.apache.tools.ant.AntAssert.assertContains;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
@@ -189,7 +190,7 @@ public class ProjectTest {
         } catch (BuildException e) {
             assertEquals(message, e.getMessage());
             mbl.assertEmpty();
-            assertTrue(!p.getTaskDefinitions().containsKey(dummyName));
+            assertFalse(p.getTaskDefinitions().containsKey(dummyName));
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/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 c943d3e..5b338bb 100644
--- a/src/tests/junit/org/apache/tools/ant/PropertyExpansionTest.java
+++ b/src/tests/junit/org/apache/tools/ant/PropertyExpansionTest.java
@@ -90,9 +90,8 @@ public class PropertyExpansionTest {
     /**
      * little helper method to validate stuff
      */
-    private void assertExpandsTo(String source,String expected) {
-        String actual = buildRule.getProject().replaceProperties(source);
-        assertEquals(source,expected,actual);
+    private void assertExpandsTo(String source, String expected) {
+        assertEquals(source, expected, 
buildRule.getProject().replaceProperties(source));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/taskdefs/AntStructureTest.java
----------------------------------------------------------------------
diff --git 
a/src/tests/junit/org/apache/tools/ant/taskdefs/AntStructureTest.java 
b/src/tests/junit/org/apache/tools/ant/taskdefs/AntStructureTest.java
index 5c19bc4..1eb24bc 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/AntStructureTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/AntStructureTest.java
@@ -31,6 +31,7 @@ import java.util.Hashtable;
 
 import static org.apache.tools.ant.AntAssert.assertContains;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -83,31 +84,34 @@ public class AntStructureTest {
         public void printHead(PrintWriter out, Project p,
                               Hashtable<String, Class<?>> tasks,
                               Hashtable<String, Class<?>> types) {
-            assertTrue(!headCalled);
-            assertTrue(!targetCalled);
-            assertTrue(!tailCalled);
+            assertFalse(headCalled);
+            assertFalse(targetCalled);
+            assertFalse(tailCalled);
             assertEquals(0, elementCalled);
             headCalled = true;
         }
+
         public void printTargetDecl(PrintWriter out) {
             assertTrue(headCalled);
-            assertTrue(!targetCalled);
-            assertTrue(!tailCalled);
+            assertFalse(targetCalled);
+            assertFalse(tailCalled);
             assertEquals(0, elementCalled);
             targetCalled = true;
         }
+
         public void printElementDecl(PrintWriter out, Project p, String name,
                                      Class<?> element) {
             assertTrue(headCalled);
             assertTrue(targetCalled);
-            assertTrue(!tailCalled);
+            assertFalse(tailCalled);
             elementCalled++;
             this.p = p;
         }
+
         public void printTail(PrintWriter out) {
             assertTrue(headCalled);
             assertTrue(targetCalled);
-            assertTrue(!tailCalled);
+            assertFalse(tailCalled);
             assertTrue(elementCalled > 0);
             tailCalled = true;
             p.log(TAIL_CALLED);

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/taskdefs/AntTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/AntTest.java 
b/src/tests/junit/org/apache/tools/ant/taskdefs/AntTest.java
index 5fddd80..86049f8 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/AntTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/AntTest.java
@@ -65,7 +65,7 @@ public class AntTest {
         try {
             buildRule.executeTarget("test1");
             fail("recursive call");
-        } catch(BuildException ex) {
+        } catch (BuildException ex) {
             //TODO assert exception message
         }
     }
@@ -76,7 +76,7 @@ public class AntTest {
         try {
             buildRule.executeTarget("test2");
             fail("required argument not specified");
-        } catch(BuildException ex) {
+        } catch (BuildException ex) {
             //TODO assert exception message
         }
     }
@@ -87,7 +87,7 @@ public class AntTest {
         try {
             buildRule.executeTarget("test1");
             fail("recursive call");
-        } catch(BuildException ex) {
+        } catch (BuildException ex) {
             //TODO assert exception message
         }
     }
@@ -107,7 +107,7 @@ public class AntTest {
         try {
             buildRule.executeTarget("test4b");
             fail("target doesn't exist");
-        } catch(BuildException ex) {
+        } catch (BuildException ex) {
             //TODO assert exception message
         }
     }
@@ -327,7 +327,7 @@ public class AntTest {
         try {
             buildRule.executeTarget("infinite-loop-via-depends");
             fail("recursive call");
-        } catch(BuildException ex) {
+        } catch (BuildException ex) {
             //TODO assert exception message
         }
     }
@@ -371,7 +371,7 @@ public class AntTest {
         try {
             buildRule.executeTarget("blank-target");
             fail("target name must not be empty");
-        } catch(BuildException ex) {
+        } catch (BuildException ex) {
             //TODO assert exception message
         }
     }

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/taskdefs/ConcatTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/ConcatTest.java 
b/src/tests/junit/org/apache/tools/ant/taskdefs/ConcatTest.java
index daec44b..58b883d 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/ConcatTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/ConcatTest.java
@@ -31,6 +31,7 @@ import java.io.IOException;
 
 import static org.apache.tools.ant.AntAssert.assertContains;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -240,7 +241,7 @@ public class ConcatTest {
         try {
             buildRule.executeTarget("samefile");
             fail("Build exception should have been thrown - output file same 
as input");
-        } catch(BuildException ex) {
+        } catch (BuildException ex) {
             //TODO assert value
         }
     }
@@ -261,7 +262,7 @@ public class ConcatTest {
     public void testmultireader() {
         buildRule.executeTarget("testmultireader");
         assertTrue(buildRule.getLog().contains("Bye"));
-        assertTrue(!buildRule.getLog().contains("Hello"));
+        assertFalse(buildRule.getLog().contains("Hello"));
     }
     /**
      * Check if fixlastline works

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/taskdefs/CopyTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/CopyTest.java 
b/src/tests/junit/org/apache/tools/ant/taskdefs/CopyTest.java
index 5b36d05..f261289 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/CopyTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/CopyTest.java
@@ -35,6 +35,7 @@ import java.io.IOException;
 
 import static org.apache.tools.ant.AntAssert.assertContains;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
@@ -105,7 +106,7 @@ public class CopyTest {
     @Test
     public void testFilterTest() {
         buildRule.executeTarget("filtertest");
-        assertTrue(!buildRule.getLog().contains("loop in tokens"));
+        assertFalse(buildRule.getLog().contains("loop in tokens"));
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/taskdefs/DefaultExcludesTest.java
----------------------------------------------------------------------
diff --git 
a/src/tests/junit/org/apache/tools/ant/taskdefs/DefaultExcludesTest.java 
b/src/tests/junit/org/apache/tools/ant/taskdefs/DefaultExcludesTest.java
index 06ca3a2..c1392d2 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/DefaultExcludesTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/DefaultExcludesTest.java
@@ -159,8 +159,11 @@ public class DefaultExcludesTest {
         assertEquals(message + " : string array length match", 
expected.length, actual.length);
         for (String element : expected) {
             boolean found = false;
-            for (int i = 0; !found && i < actual.length; i++) {
-                found |= element.equals(actual[i]);
+            for (String member : actual) {
+                found |= element.equals(member);
+                if (found) {
+                    break;
+                }
             }
             assertTrue(message + " : didn't find element "
                     + element + " in array match", found);

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/taskdefs/EchoTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/EchoTest.java 
b/src/tests/junit/org/apache/tools/ant/taskdefs/EchoTest.java
index 6f0c7a9..67715dc 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/EchoTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/EchoTest.java
@@ -68,7 +68,7 @@ public class EchoTest {
         echo.setEncoding("UTF-8");
         echo.execute();
         String x = FileUtils.readFully(new InputStreamReader(new 
FileInputStream(removeThis), "UTF-8"));
-        assertEquals(x,"\u00e4\u00a9");
+        assertEquals(x, "\u00e4\u00a9");
     }
 
     @After

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java
----------------------------------------------------------------------
diff --git 
a/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java 
b/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java
index 4b8efa3..80a4ac3 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java
@@ -28,6 +28,7 @@ import org.junit.internal.AssumptionViolatedException;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertTrue;
 
 /**
@@ -127,7 +128,7 @@ public class ExecuteWatchdogTest {
         watchdog.start(process);
         int retCode = process.waitFor();
         assertFalse("process should not have been killed", 
watchdog.killedProcess());
-        assertTrue("return code is invalid: " + retCode, retCode!=0);
+        assertNotEquals("return code is invalid: " + retCode, 0, retCode);
     }
 
     @Test
@@ -139,7 +140,7 @@ public class ExecuteWatchdogTest {
         Thread thread = new Thread(() -> {
             try {
                 process.waitFor();
-            } catch(InterruptedException e) {
+            } catch (InterruptedException e) {
                 // not very nice but will do the job
                 throw new AssumptionViolatedException("process interrupted in 
thread", e);
             }

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/taskdefs/JarTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/JarTest.java 
b/src/tests/junit/org/apache/tools/ant/taskdefs/JarTest.java
index 86b18fd..3ef9b3f 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/JarTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/JarTest.java
@@ -300,7 +300,7 @@ public class JarTest {
             }
 
             assertTrue(foundSub);
-            assertTrue(!foundSubFoo);
+            assertFalse(foundSubFoo);
             assertTrue(foundFoo);
         }
     }

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/taskdefs/ManifestTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/ManifestTest.java 
b/src/tests/junit/org/apache/tools/ant/taskdefs/ManifestTest.java
index 247d919..3dbcdf1 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/ManifestTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/ManifestTest.java
@@ -37,6 +37,7 @@ import org.junit.Test;
 import static org.apache.tools.ant.AntAssert.assertContains;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
@@ -389,7 +390,7 @@ public class ManifestTest {
         buildRule.executeTarget("testUpdate");
         Manifest mf = getManifest(new File(outDir, "mftest.mf"));
         assertNotNull(mf);
-        assertTrue(!Manifest.getDefaultManifest().equals(mf));
+        assertNotEquals(Manifest.getDefaultManifest(), mf);
         String mfAsString = mf.toString();
         assertNotNull(mfAsString);
         assertTrue(mfAsString.startsWith("Manifest-Version: 2.0"));

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/taskdefs/MoveTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/MoveTest.java 
b/src/tests/junit/org/apache/tools/ant/taskdefs/MoveTest.java
index c09b6ba..529d220 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/MoveTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/MoveTest.java
@@ -28,6 +28,7 @@ import java.io.File;
 import java.io.IOException;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
 /**
@@ -69,14 +70,14 @@ public class MoveTest {
 
         buildRule.executeTarget("testDirectoryRemoval");
         String output = buildRule.getProject().getProperty("output");
-        assertTrue(!new File(output,"E/B/1").exists());
+        assertFalse(new File(output, "E/B/1").exists());
         assertTrue(new File(output, "E/C/2").exists());
-        assertTrue(new File(output,"E/D/3").exists());
-        assertTrue(new File(output,"A/B/1").exists());
-        assertTrue(!new File(output,"A/C/2").exists());
-        assertTrue(!new File(output,"A/D/3").exists());
-        assertTrue(!new File(output,"A/C").exists());
-        assertTrue(!new File(output,"A/D").exists());
+        assertTrue(new File(output, "E/D/3").exists());
+        assertTrue(new File(output, "A/B/1").exists());
+        assertFalse(new File(output, "A/C/2").exists());
+        assertFalse(new File(output, "A/D/3").exists());
+        assertFalse(new File(output, "A/C").exists());
+        assertFalse(new File(output, "A/D").exists());
     }
 
     /** Bugzilla Report 18886 */
@@ -84,10 +85,10 @@ public class MoveTest {
     public void testDirectoryRetaining() {
         buildRule.executeTarget("testDirectoryRetaining");
         String output = buildRule.getProject().getProperty("output");
-        assertTrue(new File(output,"E").exists());
-        assertTrue(new File(output,"E/1").exists());
-        assertTrue(!new File(output,"A/1").exists());
-        assertTrue(new File(output,"A").exists());
+        assertTrue(new File(output, "E").exists());
+        assertTrue(new File(output, "E/1").exists());
+        assertFalse(new File(output, "A/1").exists());
+        assertTrue(new File(output, "A").exists());
     }
 
     @Test
@@ -103,21 +104,21 @@ public class MoveTest {
     private void testCompleteDirectoryMove(String target) {
         buildRule.executeTarget(target);
         String output = buildRule.getProject().getProperty("output");
-        assertTrue(new File(output,"E").exists());
-        assertTrue(new File(output,"E/1").exists());
-        assertTrue(!new File(output,"A/1").exists());
+        assertTrue(new File(output, "E").exists());
+        assertTrue(new File(output, "E/1").exists());
+        assertFalse(new File(output, "A/1").exists());
         // <path> swallows the basedir, it seems
-        //assertTrue(!new File(getOutputDir(),"A").exists());
+        //assertFalse(new File(getOutputDir(), "A").exists());
     }
 
     @Test
     public void testPathElementMove() {
         buildRule.executeTarget("testPathElementMove");
         String output = buildRule.getProject().getProperty("output");
-        assertTrue(new File(output,"E").exists());
-        assertTrue(new File(output,"E/1").exists());
-        assertTrue(!new File(output,"A/1").exists());
-        assertTrue(new File(output,"A").exists());
+        assertTrue(new File(output, "E").exists());
+        assertTrue(new File(output, "E/1").exists());
+        assertFalse(new File(output, "A/1").exists());
+        assertTrue(new File(output, "A").exists());
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/taskdefs/SQLExecTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/SQLExecTest.java 
b/src/tests/junit/org/apache/tools/ant/taskdefs/SQLExecTest.java
index f5b72c8..3bd5b0b 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/SQLExecTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/SQLExecTest.java
@@ -34,6 +34,7 @@ import org.junit.Test;
 
 import static org.apache.tools.ant.AntAssert.assertContains;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
@@ -72,7 +73,7 @@ public class SQLExecTest {
     @Test
     public void testDriverCaching() {
         SQLExec sql = createTask(getProperties(NULL));
-        assertTrue(!SQLExec.getLoaderMap().containsKey(NULL_DRIVER));
+        assertFalse(SQLExec.getLoaderMap().containsKey(NULL_DRIVER));
         try {
             sql.execute();
             fail("BuildException should have been thrown");

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/taskdefs/SignJarTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/SignJarTest.java 
b/src/tests/junit/org/apache/tools/ant/taskdefs/SignJarTest.java
index a73854a..6a0a8ad 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/SignJarTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/SignJarTest.java
@@ -109,7 +109,7 @@ public class SignJarTest {
         try {
             buildRule.executeTarget("testTsaLocalhost");
             fail("Should have thrown exception - no TSA at localhost:0");
-        } catch(BuildException ex) {
+        } catch (BuildException ex) {
             assertEquals("jarsigner returned: 1", ex.getMessage());
         }
     }

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/taskdefs/SyncTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/SyncTest.java 
b/src/tests/junit/org/apache/tools/ant/taskdefs/SyncTest.java
index b296b7b..cb696f1 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/SyncTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/SyncTest.java
@@ -24,6 +24,7 @@ import org.junit.Rule;
 import org.junit.Test;
 
 import static org.apache.tools.ant.AntAssert.assertContains;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
 public class SyncTest {
@@ -41,7 +42,7 @@ public class SyncTest {
         buildRule.executeTarget("simplecopy");
         String d = buildRule.getProject().getProperty("dest") + "/a/b/c/d";
         assertFileIsPresent(d);
-        assertTrue(!buildRule.getFullLog().contains("dangling"));
+        assertFalse(buildRule.getFullLog().contains("dangling"));
     }
 
     @Test
@@ -51,7 +52,7 @@ public class SyncTest {
         assertFileIsNotPresent(d);
         String c = buildRule.getProject().getProperty("dest") + "/a/b/c";
         assertFileIsNotPresent(c);
-        assertTrue(!buildRule.getFullLog().contains("dangling"));
+        assertFalse(buildRule.getFullLog().contains("dangling"));
     }
 
     @Test
@@ -61,7 +62,7 @@ public class SyncTest {
         assertFileIsNotPresent(d);
         String c = buildRule.getProject().getProperty("dest") + "/a/b/c";
         assertFileIsPresent(c);
-        assertTrue(!buildRule.getFullLog().contains("dangling"));
+        assertFalse(buildRule.getFullLog().contains("dangling"));
     }
 
     @Test
@@ -123,7 +124,7 @@ public class SyncTest {
         assertFileIsPresent(d);
         String f = buildRule.getProject().getProperty("dest") + "/e/f";
         assertFileIsPresent(f);
-        assertTrue(!buildRule.getFullLog().contains("Removing orphan file:"));
+        assertFalse(buildRule.getFullLog().contains("Removing orphan file:"));
     }
 
     @Test
@@ -133,7 +134,7 @@ public class SyncTest {
         assertFileIsPresent(d);
         String f = buildRule.getProject().getProperty("dest") + "/e/f";
         assertFileIsPresent(f);
-        assertTrue(!buildRule.getFullLog().contains("Removing orphan file:"));
+        assertFalse(buildRule.getFullLog().contains("Removing orphan file:"));
     }
 
     public void assertFileIsPresent(String f) {

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/taskdefs/condition/ContainsTest.java
----------------------------------------------------------------------
diff --git 
a/src/tests/junit/org/apache/tools/ant/taskdefs/condition/ContainsTest.java 
b/src/tests/junit/org/apache/tools/ant/taskdefs/condition/ContainsTest.java
index a45b511..337b3b7 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/condition/ContainsTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/condition/ContainsTest.java
@@ -20,6 +20,7 @@ package org.apache.tools.ant.taskdefs.condition;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
 /**
@@ -33,7 +34,7 @@ public class ContainsTest  {
         Contains con = new Contains();
         con.setString("abc");
         con.setSubstring("A");
-        assertTrue(!con.eval());
+        assertFalse(con.eval());
 
         con.setCasesensitive(false);
         assertTrue(con.eval());

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/taskdefs/condition/EqualsTest.java
----------------------------------------------------------------------
diff --git 
a/src/tests/junit/org/apache/tools/ant/taskdefs/condition/EqualsTest.java 
b/src/tests/junit/org/apache/tools/ant/taskdefs/condition/EqualsTest.java
index 5f9b996..b8c40b3 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/condition/EqualsTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/condition/EqualsTest.java
@@ -20,6 +20,7 @@ package org.apache.tools.ant.taskdefs.condition;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
 /**
@@ -33,7 +34,7 @@ public class EqualsTest {
         Equals eq = new Equals();
         eq.setArg1("a");
         eq.setArg2(" a");
-        assertTrue(!eq.eval());
+        assertFalse(eq.eval());
 
         eq.setTrim(true);
         assertTrue(eq.eval());
@@ -47,7 +48,7 @@ public class EqualsTest {
         Equals eq = new Equals();
         eq.setArg1("a");
         eq.setArg2("A");
-        assertTrue(!eq.eval());
+        assertFalse(eq.eval());
 
         eq.setCasesensitive(false);
         assertTrue(eq.eval());

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/taskdefs/condition/IsReferenceTest.java
----------------------------------------------------------------------
diff --git 
a/src/tests/junit/org/apache/tools/ant/taskdefs/condition/IsReferenceTest.java 
b/src/tests/junit/org/apache/tools/ant/taskdefs/condition/IsReferenceTest.java
index 01b6b47..e8e178b 100644
--- 
a/src/tests/junit/org/apache/tools/ant/taskdefs/condition/IsReferenceTest.java
+++ 
b/src/tests/junit/org/apache/tools/ant/taskdefs/condition/IsReferenceTest.java
@@ -54,7 +54,7 @@ public class IsReferenceTest {
         try {
             buildRule.executeTarget("isreference-incomplete");
             fail("Build exception expected: refid attirbute has been omitted");
-        } catch(BuildException ex) {
+        } catch (BuildException ex) {
             assertEquals("No reference specified for isreference condition", 
ex.getMessage());
         }
     }

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/taskdefs/condition/ParserSupportsTest.java
----------------------------------------------------------------------
diff --git 
a/src/tests/junit/org/apache/tools/ant/taskdefs/condition/ParserSupportsTest.java
 
b/src/tests/junit/org/apache/tools/ant/taskdefs/condition/ParserSupportsTest.java
index 271c19b..c5c2f04 100644
--- 
a/src/tests/junit/org/apache/tools/ant/taskdefs/condition/ParserSupportsTest.java
+++ 
b/src/tests/junit/org/apache/tools/ant/taskdefs/condition/ParserSupportsTest.java
@@ -46,7 +46,7 @@ public class ParserSupportsTest {
         try {
             buildRule.executeTarget("testEmpty");
             fail("Build exception expected: " + 
ParserSupports.ERROR_NO_ATTRIBUTES);
-        } catch(BuildException ex) {
+        } catch (BuildException ex) {
             assertEquals(ParserSupports.ERROR_NO_ATTRIBUTES, ex.getMessage());
         }
     }
@@ -56,7 +56,7 @@ public class ParserSupportsTest {
         try {
             buildRule.executeTarget("testBoth");
             fail("Build exception expected: " + 
ParserSupports.ERROR_BOTH_ATTRIBUTES);
-        } catch(BuildException ex) {
+        } catch (BuildException ex) {
             assertEquals(ParserSupports.ERROR_BOTH_ATTRIBUTES, 
ex.getMessage());
         }
     }
@@ -71,7 +71,7 @@ public class ParserSupportsTest {
         try {
             buildRule.executeTarget("testPropertyNoValue");
             fail("Build exception expected: " + ParserSupports.ERROR_NO_VALUE);
-        } catch(BuildException ex) {
+        } catch (BuildException ex) {
             assertEquals(ParserSupports.ERROR_NO_VALUE, ex.getMessage());
         }
     }

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/taskdefs/email/EmailTaskTest.java
----------------------------------------------------------------------
diff --git 
a/src/tests/junit/org/apache/tools/ant/taskdefs/email/EmailTaskTest.java 
b/src/tests/junit/org/apache/tools/ant/taskdefs/email/EmailTaskTest.java
index 6363f90..f3dc622 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/email/EmailTaskTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/email/EmailTaskTest.java
@@ -45,7 +45,7 @@ public class EmailTaskTest {
         try {
             buildRule.executeTarget("test1");
             fail("Build exception expected: SMTP auth only possibly with MIME 
mail");
-        } catch(BuildException ex) {
+        } catch (BuildException ex) {
             //TODO assert exception message
         }
     }
@@ -55,7 +55,7 @@ public class EmailTaskTest {
         try {
             buildRule.executeTarget("test2");
             fail("Build exception expected: SSL only possibly with MIME mail");
-        } catch(BuildException ex) {
+        } catch (BuildException ex) {
             //TODO assert exception message
         }
     }

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/taskdefs/optional/PvcsTest.java
----------------------------------------------------------------------
diff --git 
a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/PvcsTest.java 
b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/PvcsTest.java
index 29b2685..c89ccd0 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/PvcsTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/PvcsTest.java
@@ -72,7 +72,7 @@ public class PvcsTest {
             buildRule.executeTarget("test6");
             fail("Failed executing: 
/never/heard/of/a/directory/structure/like/this/pcli lvf -z " +
                     "-aw -pr//ct4serv2/pvcs/monitor /. Exception: 
/never/heard/of/a/directory/structure/like/this/pcli: not found");
-        } catch(BuildException ex) {
+        } catch (BuildException ex) {
             //TODO assert exception message
         }
     }

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/taskdefs/optional/XmlValidateTest.java
----------------------------------------------------------------------
diff --git 
a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/XmlValidateTest.java 
b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/XmlValidateTest.java
index f0b32b0..3e9c258 100644
--- 
a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/XmlValidateTest.java
+++ 
b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/XmlValidateTest.java
@@ -165,7 +165,7 @@ public class XmlValidateTest {
         try {
             buildRule.executeTarget("testUtf8");
             fail("Invalid characters in file");
-        } catch(BuildException ex) {
+        } catch (BuildException ex) {
           //TODO assert exception message
         }
     }
@@ -181,7 +181,7 @@ public class XmlValidateTest {
         try {
             buildRule.executeTarget("testProperty.invalidXML");
             fail("XML file does not satisfy schema");
-        } catch(BuildException ex) {
+        } catch (BuildException ex) {
             //TODO assert exception message
         }
     }

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/taskdefs/optional/XsltTest.java
----------------------------------------------------------------------
diff --git 
a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/XsltTest.java 
b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/XsltTest.java
index c4aec20..66b4882 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/XsltTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/XsltTest.java
@@ -50,7 +50,7 @@ public class XsltTest {
         try {
             buildRule.executeTarget("testCatchNoDtd");
             fail("Expected failure");
-        } catch(BuildException ex) {
+        } catch (BuildException ex) {
             //TODO assert exception message
         }
     }

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/taskdefs/optional/script/ScriptDefTest.java
----------------------------------------------------------------------
diff --git 
a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/script/ScriptDefTest.java
 
b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/script/ScriptDefTest.java
index 7dd9e60..7b2d327 100644
--- 
a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/script/ScriptDefTest.java
+++ 
b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/script/ScriptDefTest.java
@@ -17,7 +17,6 @@
  */
 package org.apache.tools.ant.taskdefs.optional.script;
 
-import org.apache.tools.ant.AntAssert;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.BuildFileRule;
 import org.apache.tools.ant.Project;
@@ -28,6 +27,7 @@ import org.junit.Test;
 
 import java.io.File;
 
+import static org.apache.tools.ant.AntAssert.assertContains;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
@@ -67,8 +67,8 @@ public class ScriptDefTest {
         try {
             buildRule.executeTarget("nolang");
             fail("Absence of language attribute not detected");
-        } catch(BuildException ex) {
-            AntAssert.assertContains("requires a language attribute", 
ex.getMessage());
+        } catch (BuildException ex) {
+            assertContains("requires a language attribute", ex.getMessage());
         }
     }
 
@@ -77,8 +77,8 @@ public class ScriptDefTest {
         try {
             buildRule.executeTarget("noname");
             fail("Absence of name attribute not detected");
-        } catch(BuildException ex) {
-            AntAssert.assertContains("scriptdef requires a name attribute", 
ex.getMessage());
+        } catch (BuildException ex) {
+            assertContains("scriptdef requires a name attribute", 
ex.getMessage());
         }
     }
 
@@ -108,8 +108,8 @@ public class ScriptDefTest {
         try {
             buildRule.executeTarget("exception");
             fail("Should have thrown an exception in the script");
-        } catch(BuildException ex) {
-            AntAssert.assertContains("TypeError", ex.getMessage());
+        } catch (BuildException ex) {
+            assertContains("TypeError", ex.getMessage());
         }
     }
 
@@ -126,8 +126,8 @@ public class ScriptDefTest {
         try {
             buildRule.executeTarget("doubleAttributeDef");
             fail("Should have detected duplicate attirbute definition");
-        } catch(BuildException ex) {
-            AntAssert.assertContains("attr1 attribute more than once", 
ex.getMessage());
+        } catch (BuildException ex) {
+            assertContains("attr1 attribute more than once", ex.getMessage());
         }
     }
 
@@ -156,7 +156,7 @@ public class ScriptDefTest {
             fail("should have failed with reader's encoding [" + 
readerEncoding +
                 "] different from the writer's encoding [" +
                 
buildRule.getProject().getProperty("useSrcAndEncoding.encoding") + "]");
-        } catch(BuildException e) {
+        } catch (BuildException e) {
             assertTrue(e.getMessage().matches(
                     "expected <eacute \\[\u00e9]> but was <eacute 
\\[\u00c3\u00a9]>"));
         }

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/types/optional/ScriptSelectorTest.java
----------------------------------------------------------------------
diff --git 
a/src/tests/junit/org/apache/tools/ant/types/optional/ScriptSelectorTest.java 
b/src/tests/junit/org/apache/tools/ant/types/optional/ScriptSelectorTest.java
index 304d6d0..a75a663 100644
--- 
a/src/tests/junit/org/apache/tools/ant/types/optional/ScriptSelectorTest.java
+++ 
b/src/tests/junit/org/apache/tools/ant/types/optional/ScriptSelectorTest.java
@@ -44,7 +44,7 @@ public class ScriptSelectorTest {
         try {
             buildRule.executeTarget("testNolanguage");
             fail("Absence of language attribute not detected");
-        } catch(BuildException ex) {
+        } catch (BuildException ex) {
             assertContains("script language must be specified", 
ex.getMessage());
 
         }

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/util/CollectionUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/util/CollectionUtilsTest.java 
b/src/tests/junit/org/apache/tools/ant/util/CollectionUtilsTest.java
index 9a4d50b..a1aa45f 100644
--- a/src/tests/junit/org/apache/tools/ant/util/CollectionUtilsTest.java
+++ b/src/tests/junit/org/apache/tools/ant/util/CollectionUtilsTest.java
@@ -25,6 +25,7 @@ import java.util.Vector;
 
 import org.junit.Test;
 
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
 /**
@@ -36,8 +37,8 @@ public class CollectionUtilsTest {
 
     @Test
     public void testVectorEquals() {
-        assertTrue(!CollectionUtils.equals(null, new Vector()));
-        assertTrue(!CollectionUtils.equals(new Vector(), null));
+        assertFalse(CollectionUtils.equals(null, new Vector()));
+        assertFalse(CollectionUtils.equals(new Vector(), null));
         assertTrue(CollectionUtils.equals(new Vector(), new Vector()));
         Vector<String> v1 = new Vector<>();
         Stack<String> s2 = new Stack<>();
@@ -46,27 +47,27 @@ public class CollectionUtilsTest {
         assertTrue(CollectionUtils.equals(v1, s2));
         assertTrue(CollectionUtils.equals(s2, v1));
         v1.addElement("bar");
-        assertTrue(!CollectionUtils.equals(v1, s2));
-        assertTrue(!CollectionUtils.equals(s2, v1));
+        assertFalse(CollectionUtils.equals(v1, s2));
+        assertFalse(CollectionUtils.equals(s2, v1));
         s2.push("bar");
         assertTrue(CollectionUtils.equals(v1, s2));
         assertTrue(CollectionUtils.equals(s2, v1));
         s2.push("baz");
-        assertTrue(!CollectionUtils.equals(v1, s2));
-        assertTrue(!CollectionUtils.equals(s2, v1));
+        assertFalse(CollectionUtils.equals(v1, s2));
+        assertFalse(CollectionUtils.equals(s2, v1));
         v1.addElement("baz");
         assertTrue(CollectionUtils.equals(v1, s2));
         assertTrue(CollectionUtils.equals(s2, v1));
         v1.addElement("zyzzy");
         s2.push("zyzzy2");
-        assertTrue(!CollectionUtils.equals(v1, s2));
-        assertTrue(!CollectionUtils.equals(s2, v1));
+        assertFalse(CollectionUtils.equals(v1, s2));
+        assertFalse(CollectionUtils.equals(s2, v1));
     }
 
     @Test
     public void testDictionaryEquals() {
-        assertTrue(!CollectionUtils.equals(null, new Hashtable()));
-        assertTrue(!CollectionUtils.equals(new Hashtable(), null));
+        assertFalse(CollectionUtils.equals(null, new Hashtable()));
+        assertFalse(CollectionUtils.equals(new Hashtable(), null));
         assertTrue(CollectionUtils.equals(new Hashtable(), new Properties()));
         Hashtable<String, String> h1 = new Hashtable<>();
         Properties p2 = new Properties();
@@ -75,28 +76,28 @@ public class CollectionUtilsTest {
         assertTrue(CollectionUtils.equals(h1, p2));
         assertTrue(CollectionUtils.equals(p2, h1));
         h1.put("bar", "");
-        assertTrue(!CollectionUtils.equals(h1, p2));
-        assertTrue(!CollectionUtils.equals(p2, h1));
+        assertFalse(CollectionUtils.equals(h1, p2));
+        assertFalse(CollectionUtils.equals(p2, h1));
         p2.put("bar", "");
         assertTrue(CollectionUtils.equals(h1, p2));
         assertTrue(CollectionUtils.equals(p2, h1));
         p2.put("baz", "");
-        assertTrue(!CollectionUtils.equals(h1, p2));
-        assertTrue(!CollectionUtils.equals(p2, h1));
+        assertFalse(CollectionUtils.equals(h1, p2));
+        assertFalse(CollectionUtils.equals(p2, h1));
         h1.put("baz", "");
         assertTrue(CollectionUtils.equals(h1, p2));
         assertTrue(CollectionUtils.equals(p2, h1));
         h1.put("zyzzy", "");
         p2.put("zyzzy2", "");
-        assertTrue(!CollectionUtils.equals(h1, p2));
-        assertTrue(!CollectionUtils.equals(p2, h1));
+        assertFalse(CollectionUtils.equals(h1, p2));
+        assertFalse(CollectionUtils.equals(p2, h1));
         p2.put("zyzzy", "");
         h1.put("zyzzy2", "");
         assertTrue(CollectionUtils.equals(h1, p2));
         assertTrue(CollectionUtils.equals(p2, h1));
         h1.put("dada", "1");
         p2.put("dada", "2");
-        assertTrue(!CollectionUtils.equals(h1, p2));
-        assertTrue(!CollectionUtils.equals(p2, h1));
+        assertFalse(CollectionUtils.equals(h1, p2));
+        assertFalse(CollectionUtils.equals(p2, h1));
     }
 }

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java 
b/src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java
index 1987236..3bdede4 100644
--- a/src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java
+++ b/src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java
@@ -413,7 +413,7 @@ public class FileUtilsTest {
     @Test
     public void testCreateNewFile() throws IOException {
         removeThis = new File("dummy");
-        assertTrue(!removeThis.exists());
+        assertFalse(removeThis.exists());
         FILE_UTILS.createNewFile(removeThis);
         assertTrue(removeThis.exists());
     }

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/util/LayoutPreservingPropertiesTest.java
----------------------------------------------------------------------
diff --git 
a/src/tests/junit/org/apache/tools/ant/util/LayoutPreservingPropertiesTest.java 
b/src/tests/junit/org/apache/tools/ant/util/LayoutPreservingPropertiesTest.java
index 409f755..f12f9aa 100644
--- 
a/src/tests/junit/org/apache/tools/ant/util/LayoutPreservingPropertiesTest.java
+++ 
b/src/tests/junit/org/apache/tools/ant/util/LayoutPreservingPropertiesTest.java
@@ -126,12 +126,12 @@ public class LayoutPreservingPropertiesTest {
         // and check that the resulting file looks okay
         String s = readFile(tmp);
 
-        assertTrue(!s.contains("\\ prop\\ one\\ =\\ \\ leading and"
+        assertFalse(s.contains("\\ prop\\ one\\ =\\ \\ leading and"
                 + " trailing spaces "));
         assertTrue(s.contains("\\ prop\\ one\\ =new one"));
-        assertTrue(!s.contains("prop\\ttwo=contains\\ttab"));
+        assertFalse(s.contains("prop\\ttwo=contains\\ttab"));
         assertTrue(s.contains("prop\\ttwo=new two"));
-        assertTrue(!s.contains("prop\\nthree=contains\\nnewline"));
+        assertFalse(s.contains("prop\\nthree=contains\\nnewline"));
         assertTrue(s.contains("prop\\nthree=new three"));
     }
 
@@ -291,10 +291,10 @@ public class LayoutPreservingPropertiesTest {
         assertTrue(s.contains("alpha=new value for alpha"));
         assertTrue(s.contains("beta=new value for beta"));
 
-        assertTrue(!s.contains("prop\\:seven=contains\\:colon"));
-        assertTrue(!s.contains("prop\\=eight=contains\\=equals"));
-        assertTrue(!s.contains("alpha:set with a colon"));
-        assertTrue(!s.contains("beta set with a space"));
+        assertFalse(s.contains("prop\\:seven=contains\\:colon"));
+        assertFalse(s.contains("prop\\=eight=contains\\=equals"));
+        assertFalse(s.contains("alpha:set with a colon"));
+        assertFalse(s.contains("beta set with a space"));
     }
 
     private static String readFile(File f) throws IOException {

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/util/XMLFragmentTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/util/XMLFragmentTest.java 
b/src/tests/junit/org/apache/tools/ant/util/XMLFragmentTest.java
index 576ec77..3967f25 100644
--- a/src/tests/junit/org/apache/tools/ant/util/XMLFragmentTest.java
+++ b/src/tests/junit/org/apache/tools/ant/util/XMLFragmentTest.java
@@ -66,7 +66,7 @@ public class XMLFragmentTest {
         assertEquals(Node.ELEMENT_NODE, nl.item(0).getNodeType());
         Element child1 = (Element) nl.item(0);
         assertEquals("child1", child1.getTagName());
-        assertTrue(!child1.hasAttributes());
+        assertFalse(child1.hasAttributes());
         NodeList nl2 = child1.getChildNodes();
         assertEquals(1, nl2.getLength());
         assertEquals(Node.TEXT_NODE, nl2.item(0).getNodeType());
@@ -83,7 +83,7 @@ public class XMLFragmentTest {
         assertEquals(Node.ELEMENT_NODE, nl.item(2).getNodeType());
         Element child3 = (Element) nl.item(2);
         assertEquals("child3", child3.getTagName());
-        assertTrue(!child3.hasAttributes());
+        assertFalse(child3.hasAttributes());
         nl2 = child3.getChildNodes();
         assertEquals(1, nl2.getLength());
         assertEquals(Node.ELEMENT_NODE, nl2.item(0).getNodeType());

http://git-wip-us.apache.org/repos/asf/ant/blob/4a242817/src/tests/junit/org/apache/tools/ant/util/facade/FacadeTaskHelperTest.java
----------------------------------------------------------------------
diff --git 
a/src/tests/junit/org/apache/tools/ant/util/facade/FacadeTaskHelperTest.java 
b/src/tests/junit/org/apache/tools/ant/util/facade/FacadeTaskHelperTest.java
index 6220955..d75cc05 100644
--- a/src/tests/junit/org/apache/tools/ant/util/facade/FacadeTaskHelperTest.java
+++ b/src/tests/junit/org/apache/tools/ant/util/facade/FacadeTaskHelperTest.java
@@ -58,7 +58,7 @@ public class FacadeTaskHelperTest {
         fth.setMagicValue("foo");
         assertTrue("magic has been set", fth.hasBeenSet());
         fth.setMagicValue(null);
-        assertTrue(!fth.hasBeenSet());
+        assertFalse(fth.hasBeenSet());
         fth.setImplementation("baz");
         assertTrue("set explicitly", fth.hasBeenSet());
     }

Reply via email to