From 426dfab4d73cd19de807a3b6db2c11e5ace81487 Mon Sep 17 00:00:00 2001 From: "beard%netscape.com" Date: Thu, 19 Apr 2001 17:31:34 +0000 Subject: [PATCH] loadClassName: use current class loader to find classes, before calling Class.forName(). --- js/rhino/org/mozilla/javascript/ScriptRuntime.java | 6 +++++- js/rhino/src/org/mozilla/javascript/ScriptRuntime.java | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/js/rhino/org/mozilla/javascript/ScriptRuntime.java b/js/rhino/org/mozilla/javascript/ScriptRuntime.java index 90e41fd420c8..63fe09e14570 100644 --- a/js/rhino/org/mozilla/javascript/ScriptRuntime.java +++ b/js/rhino/org/mozilla/javascript/ScriptRuntime.java @@ -2037,7 +2037,11 @@ public class ScriptRuntime { new Object[0]); if (cl != null) return cl.loadClass(className); - } + } else { + ClassLoader cl = ScriptRuntime.class.getClassLoader(); + if (cl != null) + return cl.loadClass(className); + } } catch (SecurityException e) { // fall through... } catch (IllegalAccessException e) { diff --git a/js/rhino/src/org/mozilla/javascript/ScriptRuntime.java b/js/rhino/src/org/mozilla/javascript/ScriptRuntime.java index 90e41fd420c8..63fe09e14570 100644 --- a/js/rhino/src/org/mozilla/javascript/ScriptRuntime.java +++ b/js/rhino/src/org/mozilla/javascript/ScriptRuntime.java @@ -2037,7 +2037,11 @@ public class ScriptRuntime { new Object[0]); if (cl != null) return cl.loadClass(className); - } + } else { + ClassLoader cl = ScriptRuntime.class.getClassLoader(); + if (cl != null) + return cl.loadClass(className); + } } catch (SecurityException e) { // fall through... } catch (IllegalAccessException e) {