Program: 76830
Project: 76830
Buggy source:
/** 
 * Creates a new instance of the class represented by this   {@code Class}object.  The class is instantiated as if by a   {@code new}expression with an empty argument list.  The class is initialized if it has not already been initialized.
 * @deprecated This method propagates any exception thrown by thenullary constructor, including a checked exception.  Use of this method effectively bypasses the compile-time exception checking that would otherwise be performed by the compiler. The  {@link java.lang.reflect.Constructor#newInstance(java.lang.Object) Constructor.newInstance} method avoids this problem by wrappingany exception thrown by the constructor in a (checked)  {@link java.lang.reflect.InvocationTargetException}. <p>The call <pre>  {@code clazz.newInstance()}</pre> can be replaced by <pre>  {@code clazz.getDeclaredConstructor().newInstance()}</pre> The latter sequence of calls is inferred to be able to throw the additional exception types   {@link InvocationTargetException} and {@link NoSuchMethodException}. Both of these exception types are subclasses of   {@link ReflectiveOperationException}.
 * @return  a newly allocated instance of the class represented by thisobject.
 * @throws IllegalAccessException  if the class or its nullaryconstructor is not accessible.
 * @throws InstantiationException if this  {@code Class} represents an abstract class,an interface, an array class, a primitive type, or void; or if the class has no nullary constructor; or if the instantiation fails for some other reason.
 * @throws ExceptionInInitializerError if the initializationprovoked by this method fails.
 * @throws SecurityException If a security manager, <i>s</i>, is present and the caller's class loader is not the same as or an ancestor of the class loader for the current class and invocation of  {@link SecurityManager#checkPackageAccess s.checkPackageAccess()} denies access to the packageof this class.
 */
@CallerSensitive @Deprecated(since="String_Node_Str") public T newInstance() throws InstantiationException, IllegalAccessException {
  if (System.getSecurityManager() != null) {
    checkMemberAccess(Member.PUBLIC,Reflection.getCallerClass(),false);
  }
  if (cachedConstructor == null) {
    if (this == Class.class) {
      throw new IllegalAccessException("String_Node_Str");
    }
    try {
      Class<?>[] empty={};
      final Constructor<T> c=getConstructor0(empty,Member.DECLARED);
      java.security.AccessController.doPrivileged(new java.security.PrivilegedAction<>(){
        public Void run(){
          c.setAccessible(true);
          return null;
        }
      }
);
      cachedConstructor=c;
    }
 catch (    NoSuchMethodException e) {
      throw (InstantiationException)new InstantiationException(getName()).initCause(e);
    }
  }
  Constructor<T> tmpConstructor=cachedConstructor;
  Class<?> caller=Reflection.getCallerClass();
  if (newInstanceCallerCache != caller) {
    int modifiers=tmpConstructor.getModifiers();
    Reflection.ensureMemberAccess(caller,this,this,modifiers);
    newInstanceCallerCache=caller;
  }
  try {
    return tmpConstructor.newInstance((Object[])null);
  }
 catch (  InvocationTargetException e) {
    Unsafe.getUnsafe().throwException(e.getTargetException());
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Creates a new instance of the class represented by this   {@code Class}object.  The class is instantiated as if by a   {@code new}expression with an empty argument list.  The class is initialized if it has not already been initialized.
 * @deprecated This method propagates any exception thrown by thenullary constructor, including a checked exception.  Use of this method effectively bypasses the compile-time exception checking that would otherwise be performed by the compiler. The  {@link java.lang.reflect.Constructor#newInstance(java.lang.Object) Constructor.newInstance} method avoids this problem by wrappingany exception thrown by the constructor in a (checked)  {@link java.lang.reflect.InvocationTargetException}. <p>The call <pre>  {@code clazz.newInstance()}</pre> can be replaced by <pre>  {@code clazz.getDeclaredConstructor().newInstance()}</pre> The latter sequence of calls is inferred to be able to throw the additional exception types   {@link InvocationTargetException} and {@link NoSuchMethodException}. Both of these exception types are subclasses of   {@link ReflectiveOperationException}.
 * @return  a newly allocated instance of the class represented by thisobject.
 * @throws IllegalAccessException  if the class or its nullaryconstructor is not accessible.
 * @throws InstantiationException if this  {@code Class} represents an abstract class,an interface, an array class, a primitive type, or void; or if the class has no nullary constructor; or if the instantiation fails for some other reason.
 * @throws ExceptionInInitializerError if the initializationprovoked by this method fails.
 * @throws SecurityException If a security manager, <i>s</i>, is present and the caller's class loader is not the same as or an ancestor of the class loader for the current class and invocation of  {@link SecurityManager#checkPackageAccess s.checkPackageAccess()} denies access to the packageof this class.
 */
@CallerSensitive @Deprecated(since="String_Node_Str") public T newInstance() throws InstantiationException, IllegalAccessException {
  if (System.getSecurityManager() != null) {
    checkMemberAccess(Member.PUBLIC,Reflection.getCallerClass(),false);
  }
  if (cachedConstructor == null) {
    if (this == Class.class) {
      throw new IllegalAccessException("String_Node_Str");
    }
    try {
      Class<?>[] empty={};
      final Constructor<T> c=getReflectionFactory().copyConstructor(getConstructor0(empty,Member.DECLARED));
      java.security.AccessController.doPrivileged(new java.security.PrivilegedAction<>(){
        public Void run(){
          c.setAccessible(true);
          return null;
        }
      }
);
      cachedConstructor=c;
    }
 catch (    NoSuchMethodException e) {
      throw (InstantiationException)new InstantiationException(getName()).initCause(e);
    }
  }
  Constructor<T> tmpConstructor=cachedConstructor;
  Class<?> caller=Reflection.getCallerClass();
  if (newInstanceCallerCache != caller) {
    int modifiers=tmpConstructor.getModifiers();
    Reflection.ensureMemberAccess(caller,this,this,modifiers);
    newInstanceCallerCache=caller;
  }
  try {
    return tmpConstructor.newInstance((Object[])null);
  }
 catch (  InvocationTargetException e) {
    Unsafe.getUnsafe().throwException(e.getTargetException());
    return null;
  }
}