summaryrefslogtreecommitdiffstats
path: root/vespajlib
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@verizonmedia.com>2019-04-03 22:02:01 +0200
committerJon Bratseth <bratseth@verizonmedia.com>2019-04-03 22:02:01 +0200
commit437e4869d430aa30e4c1c9829b64c358bfc812fd (patch)
tree11d0de95752e104775e6517b06f4eefb3b0bf82e /vespajlib
parent5792d3a23890edaa5d32b0f6bfc726c3e9956f3a (diff)
Consider value type in equals
Diffstat (limited to 'vespajlib')
-rw-r--r--vespajlib/src/main/java/com/yahoo/tensor/TensorType.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/tensor/TensorType.java b/vespajlib/src/main/java/com/yahoo/tensor/TensorType.java
index 5bd44cbc327..aaa25a0b058 100644
--- a/vespajlib/src/main/java/com/yahoo/tensor/TensorType.java
+++ b/vespajlib/src/main/java/com/yahoo/tensor/TensorType.java
@@ -167,10 +167,14 @@ public class TensorType {
}
@Override
- public boolean equals(Object other) {
- if (this == other) return true;
- if (other == null || getClass() != other.getClass()) return false;
- return dimensions.equals(((TensorType)other).dimensions);
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ TensorType other = (TensorType)o;
+ if ( this.valueType != other.valueType) return false;
+ if ( ! this.dimensions.equals(other.dimensions)) return false;
+ return true;
}
/** Returns whether the given type has the same dimension names as this */