JDK-8145467 : implement runtime deprecation usage detector
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.lang
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2015-12-15
  • Updated: 2018-09-11
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
tbdUnresolved
Description
Given the output of the deprecation scanner, implement an agent that instruments the application and determines whether it uses any deprecated language elements. For a deprecated class/interface/enum type, a significant event might be the loading of that type. For a method or constructor, a significant event would be the calling of that method. (Not sure how it would handle field access.)

Initial handling of a significant event would simply be logging a message to stderr or perhaps to a file. More sophisticated logging, filtering etc. is TBD.

Need to determine whether a call to a deprecated method is logged once or every time it's called. Once might seem sufficient, but if there are multiple calls from different locations, the call stack might need to be recorded.

Need to distinguish internal calls to a deprecated method from external calls. "Internal" should probably be the same, or at least very similar to, the JLS definition of when warnings are issued for use of a deprecated element. That is, a warning is not issued if the use of a deprecated element is within the same top-level class as the deprecated element.