-
CSR
-
Resolution: Approved
-
P4
-
minimal
-
Reducing the occurrence of warnings.
-
Language construct
-
SE
Summary
Update the JLS to not require deprecation warnings in import
statements.
Problem
The current JLS mandates uninformative deprecation warnings on import statements. Such warnings cannot be suppressed with an @SuppressWarnings annotation.
Solution
Change the specification to not require a warning in this case.
Specification
From JLS, the section on @Deprecated states:
A Java compiler must produce a deprecation warning when a type, method, field, or constructor whose declaration is annotated with the annotation @Deprecated is used (i.e. overridden, invoked, or referenced by name), unless:
- The use is within an entity that is itself annotated with the annotation @Deprecated; or
- The use is within an entity that is annotated to suppress the warning with the annotation @SuppressWarnings("deprecation"); or
- The use and declaration are both within the same outermost class.
See http://docs.oracle.com/javase/specs/jls/se7/html/jls-9.html#jls-9.6.3.6
The specification change is adding another bullet
- The use is within an import statement.
- csr for
-
JDK-8032211 Don't issue deprecation warnings on import statements
-
- Closed
-