Skip to content

Commit b813106

Browse files
committed
Use non-public lookup to avoid classloader issues
On some JDKs it seems that the publicLookup may get confused about which classloader to get methods from, leading to issues like #268. This fixes the issue by using the full private Lookup form. Fixes #268
1 parent 2287eaa commit b813106

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/jruby/rack/ext/Input.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class Input extends RubyObject {
4949
// set up coderange-aware concat that works with the new catWithCodeRange as well as earlier JRuby without it.
5050
// TODO: remove and replace with direct call once 9.3 is fully unsupported
5151
MethodHandle catWithCR = null;
52-
MethodHandles.Lookup lookup = MethodHandles.publicLookup();
52+
MethodHandles.Lookup lookup = MethodHandles.lookup();
5353
try {
5454
catWithCR = lookup.findVirtual(RubyString.class, "catWithCodeRange", MethodType.methodType(int.class, ByteList.class, int.class));
5555
} catch (NoSuchMethodException | IllegalAccessException e) {

0 commit comments

Comments
 (0)