commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r1669782 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java
Date Sat, 28 Mar 2015 15:05:04 GMT
Author: britter
Date: Sat Mar 28 15:05:04 2015
New Revision: 1669782

URL: http://svn.apache.org/r1669782
Log:
FindBugs: Load of known null value.

At this point if lhs is null, rhs will can not be null.
So evaluating the line with lhs == null will result in
rhs.equals(null) which should always be false.

Modified:
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java?rev=1669782&r1=1669781&r2=1669782&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/builder/DiffBuilder.java
Sat Mar 28 15:05:04 2015
@@ -882,7 +882,7 @@ public class DiffBuilder implements Buil
         }
 
         // Not array type
-        if (lhs != null ? lhs.equals(rhs) : rhs.equals(lhs)) {
+        if (lhs != null && lhs.equals(rhs)) {
             return this;
         }
 



Mime
View raw message