Skip to content

Commit

Permalink
Use publicLookup to access generated object fields
Browse files Browse the repository at this point in the history
Using lookup() appears to return a Lookup object that is stricter
about access restrictions from a parent module to a child
classloader with no module. In this case, the variables in the
reified object classes are to be wired up in accessors. Using the
lookup() version results in an error:

java.lang.IllegalAccessException: symbolic reference class is not accessible: class org.jruby.gen.RubyObject5, from class org.jruby.specialized.RubyObjectSpecializer (module org.jruby.base)
  • Loading branch information
headius committed Jan 22, 2024
1 parent 7fa8976 commit b260d48
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
*/
public class RubyObjectSpecializer {

public static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup();
public static final MethodHandles.Lookup LOOKUP = MethodHandles.publicLookup();

private static ClassAndAllocator getClassForSize(int size) {
return SPECIALIZED_CLASSES.get(size);
Expand Down

0 comments on commit b260d48

Please sign in to comment.