JDK-8316970 : Add internal annotation to mark restricted methods
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang.foreign
  • Affected Version: 22
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-09-26
  • Updated: 2023-10-05
  • Resolved: 2023-09-28
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.
JDK 22
22 b18Fixed
Related Reports
Blocks :  
Blocks :  
Blocks :  
Description
Restricted methods in the FFM API are methods that, if used incorrectly, can lead to JVM crashes, or, worse, silent memory corruption. It would be useful, for auditing purposes, to clearly mark all the restricted methods in the Java SE API as such, using an internal annotation (as we did for preview methods).

An annotation would allow us, among other things to:

* generate Lint warnings when code is compiled against restricted APIs
* automate the generation of javadoc text around restricted methods
* help classfile processor to detect all usages of restricted methods in an application jar
Comments
Changeset: 79812515 Author: Maurizio Cimadamore <mcimadamore@openjdk.org> Date: 2023-09-28 09:49:57 +0000 URL: https://git.openjdk.org/jdk/commit/798125152ba40ff2d093711629f275b5d74f0bcb
28-09-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/15947 Date: 2023-09-27 16:09:01 +0000
27-09-2023