fixed equals methods, Coverity issues 72280, 72281, 72283, 72284

This commit is contained in:
Sebastian Stenzel
2016-03-04 01:34:38 +01:00
parent e3256a747f
commit 3a725e4a16
2 changed files with 4 additions and 4 deletions

View File

@@ -104,8 +104,8 @@ abstract class CryptoNode implements Node {
if (obj instanceof CryptoNode) {
CryptoNode other = (CryptoNode) obj;
return this.getClass() == other.getClass() //
&& (this.parent == null && other.parent == null || this.parent.equals(other.parent)) //
&& (this.name == null && other.name == null || this.name.equals(other.name));
&& (this.parent == null && other.parent == null || this.parent != null && this.parent.equals(other.parent)) //
&& (this.name == null && other.name == null || this.name != null && this.name.equals(other.name));
} else {
return false;
}

View File

@@ -86,8 +86,8 @@ abstract class InMemoryNode implements Node {
if (obj instanceof InMemoryNode) {
InMemoryNode other = (InMemoryNode) obj;
return this.getClass() == other.getClass() //
&& (this.parent == null && other.parent == null || this.parent.equals(other.parent)) //
&& (this.name == null && other.name == null || this.name.equals(other.name));
&& (this.parent == null && other.parent == null || this.parent != null && this.parent.equals(other.parent)) //
&& (this.name == null && other.name == null || this.name != null && this.name.equals(other.name));
} else {
return false;
}