-
Bug
-
Resolution: Fixed
-
P4
-
1.1.7, 1.4.0, 6
-
b59
-
generic, x86
-
generic, windows_2000, windows_xp
The following paragraph should be added to the doc for java.lang.Class.newInstance:
Note that this method propagates any exception thrown by the nullary 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...)} method avoids this problem by wrapping any exception thrown by the constructor in a (checked) {@link java.lang.reflect.InvocationTargetException}.
Note that this method propagates any exception thrown by the nullary 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...)} method avoids this problem by wrapping any exception thrown by the constructor in a (checked) {@link java.lang.reflect.InvocationTargetException}.
- duplicates
-
JDK-4233093 (reflect spec) Class.newInstance() illegally throws undeclared Exceptions
-
- Closed
-