Bug 419312 - When "Incomplete 'switch' cases on enum" triggers warning, use of deprecated enum constant should not
Summary: When "Incomplete 'switch' cases on enum" triggers warning, use of deprecated ...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.2.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-12 11:08 EDT by Piotr Findeisen CLA
Modified: 2023-12-16 04:53 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Findeisen CLA 2013-10-12 11:08:24 EDT
Consider an Enum class having non-deprecated as well as deprecated constants:
enum E {
A,
B,
@Deprecated C
}

Assuming that you want to have zero warnings in the project, it's not pssible to set that "Incomplete 'switch' cases on enum" should cause warning.

This causes warning about missing case (expected):

E e = ....;
switch (e) {
case A:
case B:
}

But adding the required 'case C' triggers deprecation warning.

In my opinion, the deprecation should be marked in the code as usual (strike-through by default), but since it's required for switch completeness, it should not trigger warning.
Comment 1 Srikanth Sankaran CLA 2013-10-14 02:32:16 EDT
Thanks for taking a look.
Comment 2 Piotr Findeisen CLA 2014-02-12 04:36:11 EST
I'd like to fix all deprecation warnings in my code and configure deprecation to be an error. This is a blocker for this endeavor.
Comment 3 Eclipse Genie CLA 2020-01-03 19:00:03 EST
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 4 Stephan Herrmann CLA 2020-01-04 08:55:01 EST
This fell through the cracks.

Completely suppressing this warning doesn't sound good to me, since in otherwise warning-free code this case block will be practically dead code, that should be flagged.

OTOH a new option just for this use cases appears to be overkill.

I'm putting the bug back into the common bucket to give others a chance to chime in.
Comment 5 Eclipse Genie CLA 2021-12-25 12:07:28 EST
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 6 Eclipse Genie CLA 2023-12-16 04:53:56 EST
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.