File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
main/java/org/msgpack/type
test/java/org/msgpack/type Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,13 @@ public void writeTo(Packer pk) throws IOException {
5454 }
5555
5656 public boolean equals (Object o ) {
57- return o == this ;
57+ if (o == this ) {
58+ return true ;
59+ }
60+ if (!(o instanceof Value )) {
61+ return false ;
62+ }
63+ return ((Value ) o ).isNil ();
5864 }
5965
6066 public int hashCode () {
Original file line number Diff line number Diff line change @@ -190,6 +190,12 @@ public void testBigInteger(BigInteger v) throws Exception {
190190 }
191191 }
192192
193+ @ Test
194+ public void testNull () {
195+ Value v1 = ValueFactory .nilValue ();
196+ Value v2 = ValueFactory .nilValue ();
197+ testEquals (v1 , v2 );
198+ }
193199
194200 private boolean compatibleWithByte (long v ) {
195201 return (long )Byte .MIN_VALUE <= v && v <= (long )Byte .MAX_VALUE ;
You can’t perform that action at this time.
0 commit comments