Community
Participate
Working Groups
Given the following code, Eclipse 4.7.3a flags the declaration of @SuppressWarnings("deprecation") as a warning stating that it is "Unnecessary". However, when compiling the same code using JDK 1.8.0_171 with -Werror specified and without @SuppressWarnings("deprecation"), the compilation fails with the following: /Users/X/project/src/main/java/example/Superclass.java:14: warning: [deprecation] foo() in Superclass has been deprecated public void foo() { ^ error: warnings found and -Werror specified 1 error 1 warning public class Superclass { @Deprecated public void foo() { } } class Subclass extends Superclass { @SuppressWarnings("deprecation") public void foo() { } } Please ensure that Eclipse does not flag the use of @SuppressWarnings("deprecation") as "Unnecessary" when overriding a deprecated method.
Actually, please also ensure that Eclipse flags the absence of @SuppressWarnings("deprecation") as a deprecation warning when overriding a deprecated method with a quick fix to add the suppression.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.
The problem still occurs in Eclipse IDE for Enterprise Java and Web Developers Version: 2022-12 (4.26.0), Build id: 20221201-1913. To reproduce it: @SuppressWarnings("deprecation") public static void main(String[] args) { BigDecimal bd = new BigDecimal("3.1415") .setScale(2, BigDecimal.ROUND_HALF_EVEN); } }