Simplify equals() implementation 94/71894/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 9 May 2018 12:41:34 +0000 (14:41 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 9 May 2018 12:41:34 +0000 (14:41 +0200)
We can use a simple return statement, do that to keep sonar happy.

Change-Id: I6b7ddbf7c9b7dd65c5595879a84c559b33818905
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/odlext-parser-support/src/main/java/org/opendaylight/yangtools/odlext/parser/AnyxmlSchemaLocationEffectiveStatementImpl.java

index 8f2300951c36b4aaabf66a90c3027231584c1773..fe6b988b3c75ea54a5bcbfc1ffcff621605478d3 100644 (file)
@@ -65,15 +65,7 @@ public final class AnyxmlSchemaLocationEffectiveStatementImpl
             return false;
         }
         AnyxmlSchemaLocationEffectiveStatementImpl other = (AnyxmlSchemaLocationEffectiveStatementImpl) obj;
-        if (!Objects.equals(path, other.path)) {
-            return false;
-        }
-        if (!Objects.equals(getNodeType(), other.getNodeType())) {
-            return false;
-        }
-        if (!Objects.equals(getNodeParameter(), other.getNodeParameter())) {
-            return false;
-        }
-        return true;
+        return Objects.equals(path, other.path) && Objects.equals(getNodeType(), other.getNodeType())
+                && Objects.equals(getNodeParameter(), other.getNodeParameter());
     }
 }