Skip to content

Commit 0ca525d

Browse files
Edarkevbabanin
andauthored
Update bson/src/main/org/bson/io/BasicOutputBuffer.java
Co-authored-by: Viacheslav Babanin <frest0512@gmail.com>
1 parent 1eaffc2 commit 0ca525d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

bson/src/main/org/bson/io/BasicOutputBuffer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ public void truncateToPosition(final int newPosition) {
160160
if (newPosition > buffer.position() || newPosition < 0) {
161161
throw new IllegalArgumentException();
162162
}
163+
// The cast is required for compatibility with JDK 9+ where ByteBuffer's position method is inherited from Buffer.
163164
((Buffer) buffer).position(newPosition);
164165
}
165166

0 commit comments

Comments
 (0)