Skip to content

Commit d82b46f

Browse files
committed
Fix annoying auto IntelliJ Java 9 broken auto optimize feature code break
1 parent e7825ad commit d82b46f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/at/favre/lib/bytes/Bytes.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ public int unsignedByteAt(int index) {
10161016
*/
10171017
public char charAt(int index) {
10181018
Util.checkIndexBounds(length(), index, 2, "char");
1019-
return ByteBuffer.wrap(internalArray()).order(byteOrder).position(index).getChar();
1019+
return ((ByteBuffer) ByteBuffer.wrap(internalArray()).order(byteOrder).position(index)).getChar();
10201020
}
10211021

10221022
/**
@@ -1029,7 +1029,7 @@ public char charAt(int index) {
10291029
*/
10301030
public short shortAt(int index) {
10311031
Util.checkIndexBounds(length(), index, 2, "short");
1032-
return ByteBuffer.wrap(internalArray()).order(byteOrder).position(index).getShort();
1032+
return ((ByteBuffer) ByteBuffer.wrap(internalArray()).order(byteOrder).position(index)).getShort();
10331033
}
10341034

10351035
/**
@@ -1042,7 +1042,7 @@ public short shortAt(int index) {
10421042
*/
10431043
public int intAt(int index) {
10441044
Util.checkIndexBounds(length(), index, 4, "int");
1045-
return ByteBuffer.wrap(internalArray()).order(byteOrder).position(index).getInt();
1045+
return ((ByteBuffer) ByteBuffer.wrap(internalArray()).order(byteOrder).position(index)).getInt();
10461046
}
10471047

10481048
/**
@@ -1055,7 +1055,7 @@ public int intAt(int index) {
10551055
*/
10561056
public long longAt(int index) {
10571057
Util.checkIndexBounds(length(), index, 8, "long");
1058-
return ByteBuffer.wrap(internalArray()).order(byteOrder).position(index).getLong();
1058+
return ((ByteBuffer) ByteBuffer.wrap(internalArray()).order(byteOrder).position(index)).getLong();
10591059
}
10601060

10611061
/**

0 commit comments

Comments
 (0)