[Dive4elements-commits] [PATCH] Artifacts: instanceof null == false, so extra null check needed

Wald Commits scm-commit at wald.intevation.org
Thu Jun 20 17:56:04 CEST 2013


# HG changeset patch
# User Sascha L. Teichmann <teichmann at intevation.de>
# Date 1371743718 -7200
# Node ID 2ad7f3ada1dc029c38f52a379bb178f08ebfdc3c
# Parent  fa8425c8694cc20fcc75cf16a36d01e946279262
Artifacts: instanceof null == false, so extra null check needed.

diff -r fa8425c8694c -r 2ad7f3ada1dc artifacts/src/main/java/org/dive4elements/river/artifacts/model/Range.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/Range.java	Thu Jun 20 16:10:58 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/Range.java	Thu Jun 20 17:55:18 2013 +0200
@@ -78,10 +78,7 @@
 
     @Override
     public boolean equals(Object otherRange) {
-        if (otherRange == null) {
-            return false;
-        }
-        else if (otherRange instanceof Range) {
+        if (otherRange instanceof Range) {
             Range oRange = (Range) otherRange;
             return
                 Math.abs(oRange.start - this.start) <= EPSILON


More information about the Dive4elements-commits mailing list