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() {
17161716 * while calculating valueHash of Float32 type. Note that this is not applicable for composite
17171717 * types containing FLOAT32.
17181718 */
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 ())) {
17201723 typeToHash = Type .float64 ();
17211724 }
17221725
Original file line number Diff line number Diff line change @@ -94,6 +94,8 @@ public void untyped() {
9494 assertNull (v .getType ());
9595 assertFalse (v .isNull ());
9696 assertSame (proto , v .toProto ());
97+ assertNotEquals (0 , v .hashCode ());
98+ assertEquals (v , Value .untyped (proto ));
9799
98100 assertEquals (
99101 v , Value .untyped (com .google .protobuf .Value .newBuilder ().setStringValue ("test" ).build ()));
You can’t perform that action at this time.
0 commit comments