You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the method putLongAsAscii in UnsafeBuffer the code
if (value == Integer.MIN_VALUE)
{
putBytes(index, MIN_LONG_VALUE);
return MIN_LONG_VALUE.length;
}
Should be
if (value == Long.MIN_VALUE)
{
putBytes(index, MIN_LONG_VALUE);
return MIN_LONG_VALUE.length;
}
To reproduce
public static void main(String...args) {
UnsafeBuffer buffer = new UnsafeBuffer(new byte[128]);
System.out.println(Integer.MIN_VALUE);
buffer.putLongAscii(0, Integer.MIN_VALUE);
System.out.println(buffer.getStringWithoutLengthAscii(0, 24));
buffer = new UnsafeBuffer(new byte[128]);
System.out.println(Long.MIN_VALUE);
buffer.putLongAscii(0, Long.MIN_VALUE);
System.out.println(buffer.getStringWithoutLengthAscii(0, 24));
buffer = new UnsafeBuffer(new byte[128]);
System.out.println(Long.MIN_VALUE-1);
buffer.putLongAscii(0, Long.MIN_VALUE-1);
System.out.println(buffer.getStringWithoutLengthAscii(0, 24));
}
The text was updated successfully, but these errors were encountered:
In the method putLongAsAscii in UnsafeBuffer the code
if (value == Integer.MIN_VALUE)
{
putBytes(index, MIN_LONG_VALUE);
return MIN_LONG_VALUE.length;
}
Should be
if (value == Long.MIN_VALUE)
{
putBytes(index, MIN_LONG_VALUE);
return MIN_LONG_VALUE.length;
}
To reproduce
public static void main(String...args) {
UnsafeBuffer buffer = new UnsafeBuffer(new byte[128]);
System.out.println(Integer.MIN_VALUE);
buffer.putLongAscii(0, Integer.MIN_VALUE);
System.out.println(buffer.getStringWithoutLengthAscii(0, 24));
buffer = new UnsafeBuffer(new byte[128]);
System.out.println(Long.MIN_VALUE);
buffer.putLongAscii(0, Long.MIN_VALUE);
System.out.println(buffer.getStringWithoutLengthAscii(0, 24));
buffer = new UnsafeBuffer(new byte[128]);
System.out.println(Long.MIN_VALUE-1);
buffer.putLongAscii(0, Long.MIN_VALUE-1);
System.out.println(buffer.getStringWithoutLengthAscii(0, 24));
}
The text was updated successfully, but these errors were encountered: