Community
Participate
Working Groups
Created attachment 283026 [details] Screenshot of the warning in imports When importing a deprecated class no warning should show up in imports if the enclosing scope were the class is actually used is annotated with a @SuppressWarnings("deprecation"). The only way to get rid of the warning right now is to annotate the whole class with @SuppressWarnings("deprecation"), but it might hide some other deprecation warning we would want to pop.
The same applies to @SuppressWarnings("restriction"). The consequence would perhaps be to *never* report deprecation or restriction warnings against imports, only against their usage. But that would be a fairly substantial change and we would need to dig into the history, why those warnings were implemented in the first place. In particular for "deprecation" we'd actually need to check if JLS requires us to raise the warning. Note that there's an easy workaround: don't import, but use the qualified name at the declaration that has @SuppressWarnings("deprecation").
Any progress on this? This currently makes it a bit cumbersome to suppress warnings as local as possible. I think the rule for imports should be that the warning is not shown if *all* references are marked as @Supress
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.