Properly return null as default constructor of an array.

Patch from Christophe Foket on the mailing list.
This commit is contained in:
Manu Sridharan 2013-01-25 10:29:49 -08:00
parent 1d06b2f764
commit ec8a0f1294
1 changed files with 1 additions and 1 deletions

View File

@ -145,7 +145,7 @@ public class ClassNewInstanceContextInterpreter extends AbstractReflectionInterp
private IMethod getPublicDefaultCtor(IClass klass) {
IMethod ctorMethod = klass.getMethod(defCtorSelector);
if (ctorMethod != null && ctorMethod.isPublic()) {
if (ctorMethod != null && ctorMethod.isPublic() && ctorMethod.getDeclaringClass() == klass) {
return ctorMethod;
}
return null;