Fix bug 462827: Do not wrap JavaAdapter if it implements o.m.j.Scriptable
git-svn-id: svn://10.0.0.236/trunk@255039 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -204,7 +204,15 @@ public final class JavaAdapter implements IdFunctionCall
|
||||
try {
|
||||
Object adapter = adapterClass.getConstructor(ctorParms).
|
||||
newInstance(ctorArgs);
|
||||
return getAdapterSelf(adapterClass, adapter);
|
||||
Object self = getAdapterSelf(adapterClass, adapter);
|
||||
// Return unwrapped JavaAdapter if it implements Scriptable
|
||||
if (self instanceof Wrapper) {
|
||||
Object unwrapped = ((Wrapper) self).unwrap();
|
||||
if (unwrapped instanceof Scriptable) {
|
||||
return unwrapped;
|
||||
}
|
||||
}
|
||||
return self;
|
||||
} catch (Exception ex) {
|
||||
throw Context.throwAsScriptRuntimeEx(ex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user