diff --git a/core/src/main/java/org/jruby/javasupport/Java.java b/core/src/main/java/org/jruby/javasupport/Java.java index 66bbb136dc5..18e033004ad 100644 --- a/core/src/main/java/org/jruby/javasupport/Java.java +++ b/core/src/main/java/org/jruby/javasupport/Java.java @@ -414,7 +414,7 @@ public static RubyModule getProxyClass(Ruby runtime, JavaClass javaClass) { @SuppressWarnings("deprecation") public static RubyModule getProxyClass(final Ruby runtime, final Class clazz) { - return getProxyClass(runtime, clazz, false); + return getProxyClass(runtime, clazz, Options.JI_EAGER_CONSTANTS.load()); } @SuppressWarnings("deprecation") diff --git a/core/src/main/java/org/jruby/util/cli/Options.java b/core/src/main/java/org/jruby/util/cli/Options.java index c76ea052371..af72ffad0ac 100644 --- a/core/src/main/java/org/jruby/util/cli/Options.java +++ b/core/src/main/java/org/jruby/util/cli/Options.java @@ -194,6 +194,7 @@ public class Options { public static final Option JI_LOAD_LAZY = bool(JAVA_INTEGRATION, "ji.load.lazy", true, "Load Java support (class extensions) lazily on demand or ahead of time."); public static final Option JI_CLOSE_CLASSLOADER = bool(JAVA_INTEGRATION, "ji.close.classloader", false, "Close the JRubyClassLoader used by each runtime"); public static final Option JI_NESTED_JAR_TMPDIR = string(JAVA_INTEGRATION, "ji.nested.jar.tmpdir", "Use specified dir as a base for unpacking nested jar files."); + public static final Option JI_EAGER_CONSTANTS = bool(JAVA_INTEGRATION, "ji.eager.constants", true, "Eagerly bind Java:: constants for newly-encountered classes"); public static final Option PROFILE_MAX_METHODS = integer(PROFILING, "profile.max.methods", 100000, "Maximum number of methods to consider for profiling.");