Bug 533532 - [save actions] Missing @Deprecated annotation isn't added to enum literals
Summary: [save actions] Missing @Deprecated annotation isn't added to enum literals
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.7.3   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-13 03:20 EDT by Lukas Eder CLA
Modified: 2023-04-19 15:11 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Eder CLA 2018-04-13 03:20:39 EDT
I have the following save action in my project:

* Add missing '@Deprecated' annotations

Now, create X.java with these types, and then save:

// ------------------------------------------------
class X {

    /**
     * @deprecated
     */
    static final String S = "abc";
}

enum E {

    /**
     * @deprecated
     */
    S;
}
// ------------------------------------------------

The result is:

// ------------------------------------------------
class X {

    /**
     * @deprecated
     */
    @Deprecated
    static final String S = "abc";
}

enum E {

    /**
     * @deprecated
     */
    S;
}
// ------------------------------------------------

I get a warning on E.S:

> The deprecated field E.S should be annotated with @Deprecated

Notice that there even isn't any quick fix on E.S available to add the annotation. On X.S, a quick fix is available called

> Add missing @Deprecated annotation
Comment 1 Eclipse Genie CLA 2020-07-31 16:14:19 EDT
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.
Comment 2 Lukas Eder CLA 2021-04-23 03:35:39 EDT
I was going to report this again, but then I saw, I have reported it already :) Still present in 4.19
Comment 3 Eclipse Genie CLA 2023-04-19 15:11:32 EDT
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.