Skip to content

Commit

Permalink
Using reflection to unmonitor a reference results in errors in Java 17
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-lawrey authored and JerryShea committed May 20, 2024
1 parent 463cf2c commit f0e0018
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/net/openhft/chronicle/bytes/AbstractBytes.java
Original file line number Diff line number Diff line change
Expand Up @@ -1535,6 +1535,12 @@ public int copyTo(byte[] bytes) throws BufferUnderflowException, ClosedIllegalSt
return (int) read(readPosition(), bytes, 0, bytes.length);
}

@Override
public void unmonitor() {
super.unmonitor();
Monitorable.unmonitor(bytesStore);
}

static final class ReportUnoptimised {
static {
Jvm.reportUnoptimised();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,12 @@ public Bytes<U> write8bit(@Nullable BytesStore bs) throws BufferOverflowExceptio
return uncheckedRandomDataInput;
}

@Override
public void unmonitor() {
super.unmonitor();
Monitorable.unmonitor(bytesStore);
}

private final class UncheckedRandomDataInputHolder implements UncheckedRandomDataInput {

@Override
Expand Down

0 comments on commit f0e0018

Please sign in to comment.