JDK-8168681 : Correct deprecation text for Class.newInstance
Type:Sub-task
Component:core-libs
Sub-Component:java.lang:reflect
Affected Version:9
Priority:P4
Status:Resolved
Resolution:Fixed
Submitted:2016-10-25
Updated:2016-11-11
Resolved:2016-11-03
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
The current suggested replacement text is
"The call
clazz.newInstance()
can be replaced by
clazz.getConstructor().newInstance()"
However, using "getDeclaredConstructor()" is most likely the better replacement since it should be able to find and call non-public constructors when that is permissible.