JDK-8187956 : Deprecated Class::newInstance does not emit illegal reflective access warning
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang.module
  • Affected Version: 9,10
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2017-09-26
  • Updated: 2019-05-25
  • Resolved: 2019-05-25
Related Reports
Duplicate :  
Description
If public classes in non-exported packages are instantiated with Class::newInstance then an illegal reflective access warning is not printed.

This is an oversight in the original implementation, no issue with Constructor newInstance.
Comments
This issue has fixed as a side effect of JDK-8206240 in JDK 12.
25-05-2019