FULL PRODUCT VERSION :
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Mac OS X 10.10.1
A DESCRIPTION OF THE PROBLEM :
When creating CharBuffer using ByteBuffer.asCharBuffer(), the instance of the ByteBufferAsCharBufferB is created and it has memeber
protected final ByteBuffer bb
Which is filled with the buffer bytes, but when calling array() method on it (method from the super class), the array method check if the member hb from the super class in not null, but it's null then the exception is thrown.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
CharBuffer cBuffer = ByteBuffer.wrap(...byte array).asCharBuffer();
cBuffer.array();
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expected char array
ACTUAL -
java.lang.UnsupportedOperationException is thrown.
Caused by: java.lang.UnsupportedOperationException
at java.nio.CharBuffer.array(CharBuffer.java:994)
ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.lang.UnsupportedOperationException is thrown.
Caused by: java.lang.UnsupportedOperationException
at java.nio.CharBuffer.array(CharBuffer.java:994)
REPRODUCIBILITY :
This bug can be reproduced always.
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Mac OS X 10.10.1
A DESCRIPTION OF THE PROBLEM :
When creating CharBuffer using ByteBuffer.asCharBuffer(), the instance of the ByteBufferAsCharBufferB is created and it has memeber
protected final ByteBuffer bb
Which is filled with the buffer bytes, but when calling array() method on it (method from the super class), the array method check if the member hb from the super class in not null, but it's null then the exception is thrown.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
CharBuffer cBuffer = ByteBuffer.wrap(...byte array).asCharBuffer();
cBuffer.array();
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expected char array
ACTUAL -
java.lang.UnsupportedOperationException is thrown.
Caused by: java.lang.UnsupportedOperationException
at java.nio.CharBuffer.array(CharBuffer.java:994)
ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.lang.UnsupportedOperationException is thrown.
Caused by: java.lang.UnsupportedOperationException
at java.nio.CharBuffer.array(CharBuffer.java:994)
REPRODUCIBILITY :
This bug can be reproduced always.