mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-19 19:21:27 +00:00
fixed equals methods, Coverity issues 72280, 72281, 72283, 72284
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user