JDK-8264138 : Replace uses of Class.newInstance
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: openjfx16
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-03-24
  • Updated: 2021-06-01
  • Resolved: 2021-05-18
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.

To download the current JDK release, click here.
Other
openjfx17Fixed
Related Reports
Relates :  
Relates :  
Description
The Class.newInstance() method is deprecated in favor of Contructor.newinstance(). According to the API docs for the former:

    clazz.newInstance()

can be replaced by

    clazz.getDeclaredConstructor().newInstance()
 
There are 12 calls to newInstance in JavaFX, 9 in javafx.graphics and 3 in javafx.fxml
Comments
Changeset: 4619cddf Author: Ajit Ghaisas <aghaisas@openjdk.org> Date: 2021-05-18 04:52:48 +0000 URL: https://git.openjdk.java.net/jfx/commit/4619cddfb961ab215cac10c91b828342d10299df
18-05-2021

See the attached log file. This was generated by running: gradle --info -PLINT="deprecation"
24-03-2021