Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed NoSuchMethodError: java.nio.StringCharBuffer.nextGetIndex #498

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/classes/modules/java.base/java/nio/ByteBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ public ByteBuffer putLong(long x) {

return this;
}
public int arrayOffset(){
return offset;
}

@Override
public byte[] array() {
Expand Down Expand Up @@ -316,4 +319,9 @@ public boolean equals(Object ob) {
Object base() {
return array;
}
@Override
public final ByteBuffer flip() {
super.flip();
return this;
}
}
3 changes: 3 additions & 0 deletions src/classes/modules/java.base/java/nio/CharBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ public static CharBuffer wrap(CharSequence outMess) {
charBuffer.flip();
return charBuffer;
}
public int arrayOffset(){
return offset;
}

@Override
public char[] array() {
Expand Down
16 changes: 16 additions & 0 deletions src/tests/CharBufferTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import gov.nasa.jpf.util.test.TestJPF;
import org.junit.Test;

import java.nio.CharBuffer;
import java.nio.charset.CharacterCodingException;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.StandardCharsets;

public class CharBufferTest extends TestJPF {
@Test
public void Test_Wrap() throws CharacterCodingException {
if(verifyNoPropertyViolation()){
java.nio.charset.StandardCharsets.UTF_8.newEncoder().encode(java.nio.CharBuffer.wrap("heyo"));
}
}
}
Loading