Skip to content

Commit 92b4cf8

Browse files
committed
What it takes to make JI load
1 parent d3bde22 commit 92b4cf8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

core/src/main/java/org/jruby/Ruby.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1772,7 +1772,7 @@ private void initJavaSupport(ThreadContext context) {
17721772
// if we can't use reflection, 'jruby' and 'java' won't work; no load.
17731773
boolean reflectionWorks = doesReflectionWork();
17741774

1775-
if (reflectionWorks && profile.allowLoad("java")) {
1775+
if (reflectionWorks) {
17761776
new Java().load(context.runtime, false);
17771777
new JRubyUtilLibrary().load(context.runtime, false);
17781778

core/src/test/java/org/jruby/javasupport/JavaEmbedUtilsTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ class CustomProfile implements Profile {
7070
private List classAllow = List.of("String", "Fixnum", "Integer", "Numeric", "Hash", "Array",
7171
"Thread", "ThreadGroup", "RubyError", "StopIteration", "LoadError", "ArgumentError", "Encoding",
7272
"EncodingError", "StandardError", "Exception");
73+
private List loadAllow = List.of("jruby/java.rb", "jruby/java/core_ext.rb", "jruby/java/java_ext.rb",
74+
"jruby/java/core_ext/object.rb");
7375

7476
@Override
7577
public boolean allowBuiltin(String name) {
@@ -88,7 +90,7 @@ public boolean allowModule(String name) {
8890

8991
@Override
9092
public boolean allowLoad(String name) {
91-
return false;
93+
return loadAllow.contains(name);
9294
}
9395

9496
@Override

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy