JDK-8280744 : Allow SuppressWarnings to be used in all declaration contexts
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 19
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-01-26
  • Updated: 2022-01-31
  • Resolved: 2022-01-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 19
19 masterFixed
Related Reports
CSR :  
Relates :  
Relates :  
Description
The SuppressWarnings annotation type is declared have multiple targets, including modules; however, "package" is left off of its target list. As package-info file are another kind of declaration where a compiler could give warnings, allowing SuppressWarnings in that case is reasonable.

Wanting SuppressWarnings in package-info file came up while working on doclint warnings (JDK-8280534).
Comments
Changeset: 78574057 Author: Joe Darcy <darcy@openjdk.org> Date: 2022-01-28 00:44:13 +0000 URL: https://git.openjdk.java.net/jdk/commit/78574057a4758fc3da5f39af77df09dc2232a9a1
28-01-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/7239 Date: 2022-01-26 21:22:58 +0000
27-01-2022