A DESCRIPTION OF THE REQUEST :
Position throws an IllegalArgumentException if the new position is > limit or < 0 but doesn't state what the new position is. The exception should contain the position in error in its message string.
JUSTIFICATION :
It is hard to debug position related bugs without this change.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
an IllegalArgumentException with a message like:
String.format("New position is %d, but cannot be > %d or < 0", newPosition, limit)
ACTUAL -
An IllegalArgumentException with no message at all.
---------- BEGIN SOURCE ----------
ByteBuffer.allocate(1).position(10);
---------- END SOURCE ----------
Position throws an IllegalArgumentException if the new position is > limit or < 0 but doesn't state what the new position is. The exception should contain the position in error in its message string.
JUSTIFICATION :
It is hard to debug position related bugs without this change.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
an IllegalArgumentException with a message like:
String.format("New position is %d, but cannot be > %d or < 0", newPosition, limit)
ACTUAL -
An IllegalArgumentException with no message at all.
---------- BEGIN SOURCE ----------
ByteBuffer.allocate(1).position(10);
---------- END SOURCE ----------
- duplicates
-
JDK-8065556 (bf) Buffer.position and other methods should include detail in IAE
-
- Closed
-