diff --git a/mozilla/js/rhino/src/org/mozilla/javascript/jdk15/VMBridge_jdk15.java b/mozilla/js/rhino/src/org/mozilla/javascript/jdk15/VMBridge_jdk15.java index 81c2fda9335..6c10b035394 100644 --- a/mozilla/js/rhino/src/org/mozilla/javascript/jdk15/VMBridge_jdk15.java +++ b/mozilla/js/rhino/src/org/mozilla/javascript/jdk15/VMBridge_jdk15.java @@ -45,11 +45,17 @@ import org.mozilla.javascript.*; public class VMBridge_jdk15 extends org.mozilla.javascript.jdk13.VMBridge_jdk13 { - public VMBridge_jdk15() throws SecurityException, NoSuchMethodException { - // Just try and see if we can access isVarArgs() on this constructor; - // want to fail loading if the method doesn't exist so that we can - // load a bridge to an older JDK - VMBridge_jdk15.class.getConstructor(new Class[] {}).isVarArgs(); + public VMBridge_jdk15() throws SecurityException, InstantiationException { + try { + // Just try and see if we can access the isVarArgs method. + // We want to fail loading if the method does not exist + // so that we can load a bridge to an older JDK instead. + Method.class.getMethod("isVarArgs", (Class[]) null); + } catch (NoSuchMethodException e) { + // Throw a fittitng exception that is handled by + // org.mozilla.javascript.Kit.newInstanceOrNull: + throw new InstantiationException(e.getMessage()); + } } public boolean isVarArgs(Member member) {