File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
core/src/main/java/org/jruby Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -1407,7 +1407,15 @@ public void setProfilingService( String service ) {
14071407 }
14081408
14091409 private static ClassLoader setupLoader () {
1410- return RubyInstanceConfig .class .getClassLoader ();
1410+ ClassLoader loader = RubyInstanceConfig .class .getClassLoader ();
1411+
1412+ // loader can be null for example when jruby comes from the boot-classLoader
1413+
1414+ if (loader == null ) {
1415+ loader = Thread .currentThread ().getContextClassLoader ();
1416+ }
1417+
1418+ return loader ;
14111419 }
14121420
14131421 ////////////////////////////////////////////////////////////////////////////
@@ -1454,9 +1462,11 @@ private static ClassLoader setupLoader() {
14541462 private ProfileOutput profileOutput = new ProfileOutput (System .err );
14551463 private String profilingService ;
14561464
1457- private ClassLoader thisLoader = setupLoader ();
1458- // thisLoader can be null for example when jruby comes from the boot-classLoader
1459- private ClassLoader loader = thisLoader == null ? Thread .currentThread ().getContextClassLoader () : thisLoader ;
1465+ private ClassLoader loader = setupLoader ();
1466+
1467+ public ClassLoader getCurrentThreadClassLoader () {
1468+ return Thread .currentThread ().getContextClassLoader ();
1469+ }
14601470
14611471 // from CommandlineParser
14621472 private List <String > loadPaths = new ArrayList <String >();
You can’t perform that action at this time.
0 commit comments