Accepting patch for bug 391439: Exception on startup on JDK 1.4.

Patch from Jürg Lehni.


git-svn-id: svn://10.0.0.236/trunk@238973 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
nboyd%atg.com
2007-11-08 13:12:05 +00:00
parent 23a8c2c22d
commit 5cf0b2e780

View File

@@ -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) {