Skip to content

Commit

Permalink
Use private lookup for these handles
Browse files Browse the repository at this point in the history
publicLookup seems to have trouble when there are multiple versions
of a signature class in the classloader hierarchy.

Fixes #112
  • Loading branch information
headius committed Feb 13, 2025
1 parent 94d4d67 commit 98aceb0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/java/org/jruby/ext/stringio/StringIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -1529,7 +1529,7 @@ public IRubyObject write(ThreadContext context, IRubyObject[] args) {

static {
MethodHandle cat, modify, substr;
MethodHandles.Lookup lookup = MethodHandles.publicLookup();
MethodHandles.Lookup lookup = MethodHandles.lookup();
try {
cat = lookup.findVirtual(RubyString.class, "catWithCodeRange", MethodType.methodType(RubyString.class, RubyString.class));
modify = lookup.findVirtual(RubyString.class, "modifyAndClearCodeRange", MethodType.methodType(void.class));
Expand Down

0 comments on commit 98aceb0

Please sign in to comment.