Content-Length: 308723 | pFad | http://github.com/jruby/jruby/commit/92b4cf8268d8858523dd85061a048bed2901518c

82 What it takes to make JI load · jruby/jruby@92b4cf8 · GitHub
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/jruby/jruby/commit/92b4cf8268d8858523dd85061a048bed2901518c

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy