From cc16577d157472f7edcf50b0b1933df06a51ff10 Mon Sep 17 00:00:00 2001 From: Fang Zheng Date: Fri, 29 Dec 2023 22:56:29 -0800 Subject: [PATCH] Fix bug in ImmutableTimestampValueImpl. --- .../org/msgpack/value/impl/ImmutableTimestampValueImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/msgpack-core/src/main/java/org/msgpack/value/impl/ImmutableTimestampValueImpl.java b/msgpack-core/src/main/java/org/msgpack/value/impl/ImmutableTimestampValueImpl.java index 227c85d0..20ebeb81 100644 --- a/msgpack-core/src/main/java/org/msgpack/value/impl/ImmutableTimestampValueImpl.java +++ b/msgpack-core/src/main/java/org/msgpack/value/impl/ImmutableTimestampValueImpl.java @@ -93,7 +93,7 @@ public byte[] getData() long sec = getEpochSecond(); int nsec = getNano(); if (sec >>> 34 == 0) { - long data64 = (nsec << 34) | sec; + long data64 = ((long)nsec << 34) | sec; if ((data64 & 0xffffffff00000000L) == 0L) { bytes = new byte[4]; MessageBuffer.wrap(bytes).putInt(0, (int) sec);