commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1034904 - /commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/concurrent/ConstantInitializerTest.java
Date Sat, 13 Nov 2010 23:16:50 GMT
Author: sebb
Date: Sat Nov 13 23:16:49 2010
New Revision: 1034904

URL: http://svn.apache.org/viewvc?rev=1034904&view=rev
Log:
Revert bad update in r1034828; fix NPE warning a different way

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=1034904&r1=1034903&r2=1034904&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 23:16:49 2010
@@ -17,7 +17,6 @@
 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;
@@ -51,11 +50,12 @@ public class ConstantInitializerTest {
      */
     private void checkEquals(Object obj, boolean expected) {
         assertEquals("Wrong result of equals", expected, init.equals(obj));
-        assertNotNull(obj);
-        assertEquals("Not symmetric", expected, obj.equals(init));
-        if (expected) {
-            assertEquals("Different hash codes", init.hashCode(),
-                    obj.hashCode());
+        if (obj != null) {
+            assertEquals("Not symmetric", expected, obj.equals(init));
+            if (expected) {
+                assertEquals("Different hash codes", init.hashCode(),
+                        obj.hashCode());
+            }
         }
     }
 



Mime
View raw message