commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1336983 - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math3/linear/ArrayRealVector.java main/java/org/apache/commons/math3/util/DefaultTransformer.java test/java/org/apache/commons/math3/util/PairTest.java
Date Fri, 11 May 2012 00:38:30 GMT
Author: sebb
Date: Fri May 11 00:38:29 2012
New Revision: 1336983

URL: http://svn.apache.org/viewvc?rev=1336983&view=rev
Log:
Redundant check for null; null is not an instanceof any Object

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/ArrayRealVector.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/DefaultTransformer.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math3/util/PairTest.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/ArrayRealVector.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/ArrayRealVector.java?rev=1336983&r1=1336982&r2=1336983&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/ArrayRealVector.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/linear/ArrayRealVector.java
Fri May 11 00:38:29 2012
@@ -823,7 +823,7 @@ public class ArrayRealVector extends Rea
             return true;
         }
 
-        if (other == null || !(other instanceof RealVector)) {
+        if (!(other instanceof RealVector)) {
             return false;
         }
 

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/DefaultTransformer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/DefaultTransformer.java?rev=1336983&r1=1336982&r2=1336983&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/DefaultTransformer.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/DefaultTransformer.java
Fri May 11 00:38:29 2012
@@ -69,9 +69,6 @@ public class DefaultTransformer implemen
         if (this == other) {
             return true;
         }
-        if (other == null) {
-            return false;
-        }
         return other instanceof DefaultTransformer;
     }
 

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math3/util/PairTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/util/PairTest.java?rev=1336983&r1=1336982&r2=1336983&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math3/util/PairTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math3/util/PairTest.java Fri
May 11 00:38:29 2012
@@ -78,9 +78,6 @@ public class PairTest {
 
         @Override
         public boolean equals(Object o) {
-            if (o == null) {
-                return false;
-            }
             if (!(o instanceof MyInteger)) {
                 return false;
             } else {



Mime
View raw message