commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1034828 - /commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/concurrent/ConstantInitializerTest.java
Date Sat, 13 Nov 2010 17:59:26 GMT
Author: sebb
Date: Sat Nov 13 17:59:25 2010
New Revision: 1034828

URL: http://svn.apache.org/viewvc?rev=1034828&view=rev
Log:
Check for Null and avoid NPE warning

Modified:
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/concurrent/ConstantInitializerTest.java

Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/concurrent/ConstantInitializerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/concurrent/ConstantInitializerTest.java?rev=1034828&r1=1034827&r2=1034828&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/concurrent/ConstantInitializerTest.java
(original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/concurrent/ConstantInitializerTest.java
Sat Nov 13 17:59:25 2010
@@ -17,6 +17,7 @@
 package org.apache.commons.lang3.concurrent;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
 import java.util.regex.Pattern;
@@ -50,9 +51,8 @@ public class ConstantInitializerTest {
      */
     private void checkEquals(Object obj, boolean expected) {
         assertEquals("Wrong result of equals", expected, init.equals(obj));
-        if (obj != null) {
-            assertEquals("Not symmetric", expected, obj.equals(init));
-        }
+        assertNotNull(obj);
+        assertEquals("Not symmetric", expected, obj.equals(init));
         if (expected) {
             assertEquals("Different hash codes", init.hashCode(),
                     obj.hashCode());



Mime
View raw message