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.

Bug 167121 - Java editor suggests adding @SuppressWarnings("deprecation") multiple times on the same method/class
Summary: Java editor suggests adding @SuppressWarnings("deprecation") multiple times o...
Status: RESOLVED DUPLICATE of bug 195178
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-15 17:32 UTC by trvs2cool
Modified: 2011-02-11 09:33 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description trvs2cool 2009-06-15 17:32:37 UTC
The java editor will suggest a fix of adding @SuppressWarnings("deprecation") when a method contains deprecated
elements.  This is nice and works fine.

However, after adding @SuppressWarnings("deprecation") to the method, the editor still hints that you should add a
suppress deprecations.  If you select it again, it will change the suppression annotation to
@SuppressWarnings({"deprecation", "deprecation"}), ad infinitum.

This is just a minor annoyance as you can never get rid of the small warning markers on the right side of the editor.

Otherwise, @SuppressWarnings("deprecation") itself works as expected.
Comment 1 trvs2cool 2009-06-15 19:41:53 UTC
Note: This behavior only occurs prior to a file being saved.  Once saved, the expected behavior results.
Comment 2 trvs2cool 2009-06-15 20:07:03 UTC
A second note:  After a bit of further use, I noticed that @SuppressWarnings("deprecation") will stop warnings/hint on
an individual method after the file has been saved.  However, if you define a class implementing a deprecated interface,
the editor will always provide the warning/hint on the implements line, even after you suppress the deprecation warns
with the annotation.

As mentioned initially, in both the case of method declarations and class declarations, if the hint does appear, it will
incorrectly add multiple "deprecation" values to the suppress annotation.
Comment 3 trvs2cool 2009-06-15 20:13:00 UTC
Sorry for all the comments.  

Here is another detail:  If you have an interface with a deprecate method and you implement that interface method, the
hint will always appear even after you have suppressed deprecation warnings.

So, if a method just calls a deprecated method, the suppression warning/hint is fine after the file is saved.  However,
if a method implements a deprecated method, the suppression warning/hint always shows and the hint can be repeatedly
selected.
Comment 4 Dusan Balek 2011-02-11 09:33:02 UTC
Already fixed in jet-main.

*** This bug has been marked as a duplicate of bug 195178 ***