Index: java/lang/Class.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/lang/Class.java,v retrieving revision 1.34 diff -u -r1.34 Class.java --- java/lang/Class.java 11 Mar 2005 11:19:54 -0000 1.34 +++ java/lang/Class.java 18 Apr 2005 08:38:02 -0000 @@ -854,7 +854,7 @@ */ public int getModifiers() { - return VMClass.getModifiers (this); + return VMClass.getModifiers (this, false); } /** @@ -1114,7 +1114,7 @@ if (constructor == null) throw new InstantiationException(getName()); if (!Modifier.isPublic(constructor.getModifiers()) - || !Modifier.isPublic(getModifiers())) + || !Modifier.isPublic(VMClass.getModifiers(this, true))) { final Constructor finalConstructor = constructor; AccessController.doPrivileged(new PrivilegedAction() @@ -1134,7 +1134,7 @@ } int modifiers = constructor.getModifiers(); if (!Modifier.isPublic(modifiers) - || !Modifier.isPublic(getModifiers())) + || !Modifier.isPublic(VMClass.getModifiers(this, true))) { Class caller = VMStackWalker.getCallingClass(); if (caller != null && Index: vm/reference/java/lang/VMClass.java =================================================================== RCS file: /cvsroot/classpath/classpath/vm/reference/java/lang/VMClass.java,v retrieving revision 1.10 diff -u -r1.10 VMClass.java --- vm/reference/java/lang/VMClass.java 25 Apr 2004 12:03:01 -0000 1.10 +++ vm/reference/java/lang/VMClass.java 18 Apr 2005 08:38:06 -0000 @@ -185,11 +185,18 @@ * public and final, but not an interface. * * @param klass the Class object that's calling us + * @param ignoreInnerClassesAttrib if set, return the real modifiers, not + * the ones specified in the InnerClasses attribute. * @return the modifiers of this class * @see Modifer * @since 1.1 */ - static native int getModifiers(Class klass); + static int getModifiers(Class klass, boolean ignoreInnerClassesAttrib) + { + return getModifiers(klass); + } + + private static native int getModifiers(Class klass); /** * If this is a nested or inner class, return the class that declared it.