This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Deprecation warning is shown on implementation of deprecated method | ||
---|---|---|---|
Product: | java | Reporter: | matthies <matthies> |
Component: | Hints | Assignee: | Svata Dedic <sdedic> |
Status: | RESOLVED INVALID | ||
Severity: | normal | CC: | jlahoda |
Priority: | P3 | ||
Version: | 8.0 | ||
Hardware: | PC | ||
OS: | Windows 7 | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
matthies
2014-07-21 22:22:45 UTC
Javac reports override deprecation even if @SuppressWarnings is present on the overriding method - that's why NetBeans hint behave the same. Move @SuppressWarnings("deprecation") to the class decl to suppress deprecations throughout the class. I have some doubts the compiler behaviour is correct, since the javadoc for @SuppressWarnings says that it suppresses warnings for the specific element - so it should be able to suppress deprecation for an individual method. JLahoda may have additional comments on javac (desired) behaviour. Regarding producing the warning when overriding a deprecated method (without @SuppressWarnings), that is specifically mandated by the JLS to my knowledge (JLS 9.6.4.6.). @SuppressWarnings should obviously suppress the warning, this has been fixed as: https://bugs.openjdk.java.net/browse/JDK-8033421 in JDK 9 codebase. I'll look into backporting options. |