Use Objects.equals() in yang-model-api
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / repo / api / SourceIdentifier.java
index 43879624c99d9da581073e72d5afffa13296e3af..fba3630573038bbcc8d3c789e7c0b030372e3704 100644 (file)
@@ -143,21 +143,7 @@ public final class SourceIdentifier implements Identifier, Immutable {
             return false;
         }
         SourceIdentifier other = (SourceIdentifier) obj;
-        if (name == null) {
-            if (other.name != null) {
-                return false;
-            }
-        } else if (!name.equals(other.name)) {
-            return false;
-        }
-        if (revision == null) {
-            if (other.revision != null) {
-                return false;
-            }
-        } else if (!revision.equals(other.revision)) {
-            return false;
-        }
-        return true;
+        return Objects.equals(name, other.name) && Objects.equals(revision, other.revision);
     }
 
     public static SourceIdentifier create(final String moduleName, final Optional<String> revision) {