< prev index next >

src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java

Print this page
@@ -181,11 +181,11 @@
                                  method.getModifiers());
      }
  
      public ConstructorAccessor newConstructorAccessor(Constructor<?> c) {
          Class<?> declaringClass = c.getDeclaringClass();
-         if (Modifier.isAbstract(declaringClass.getModifiers())) {
+         if (Modifier.isAbstract(declaringClass.getModifiers()) && declaringClass != Object.class) {
              return new InstantiationExceptionConstructorAccessorImpl(null);
          }
          if (declaringClass == Class.class) {
              return new InstantiationExceptionConstructorAccessorImpl
                  ("Can not instantiate java.lang.Class");
< prev index next >