File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
main/java/com/google/cloud/spanner
test/java/com/google/cloud/spanner Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -1716,7 +1716,10 @@ public final int hashCode() {
1716
1716
* while calculating valueHash of Float32 type. Note that this is not applicable for composite
1717
1717
* types containing FLOAT32.
1718
1718
*/
1719
- if (type .getCode () == Type .Code .FLOAT32 && !isNull && Float .isNaN (getFloat32 ())) {
1719
+ if (type != null
1720
+ && type .getCode () == Type .Code .FLOAT32
1721
+ && !isNull
1722
+ && Float .isNaN (getFloat32 ())) {
1720
1723
typeToHash = Type .float64 ();
1721
1724
}
1722
1725
Original file line number Diff line number Diff line change @@ -94,6 +94,8 @@ public void untyped() {
94
94
assertNull (v .getType ());
95
95
assertFalse (v .isNull ());
96
96
assertSame (proto , v .toProto ());
97
+ assertNotEquals (0 , v .hashCode ());
98
+ assertEquals (v , Value .untyped (proto ));
97
99
98
100
assertEquals (
99
101
v , Value .untyped (com .google .protobuf .Value .newBuilder ().setStringValue ("test" ).build ()));
You can’t perform that action at this time.
0 commit comments