Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330202 - [quick fix] Add quick fix to increment subsequent values in case statements when a duplicate exists
Summary: [quick fix] Add quick fix to increment subsequent values in case statements w...
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-14 13:46 EST by Pawel Pogorzelski CLA
Modified: 2010-11-17 04:20 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 Pawel Pogorzelski CLA 2010-11-14 13:46:13 EST
Sometimes values in case instructions are not bounded tightly to the code that they execute but are rather a mean to produce a sequence of code blocks. This is common case especially when working with stuff like table label providers.

Now imagine new column being added at index 0:
...
case 0:;
case 0:;
case 1:;
case 2:;
case 3:;
case 4:;
case 5:;
case 6:;
case 7:;
case 8:;
case 9:;
...

In this case when guessing that 0 has been added and the rest needs incrementation could be a good guess. Other quick fix available could be changing 0 to 10, the first not handled value. None of them are available as suggestions.
Comment 1 Dani Megert CLA 2010-11-15 05:29:48 EST
I'm not convinced that this is too useful.
Comment 2 Pawel Pogorzelski CLA 2010-11-17 04:20:00 EST
On the second thought number of use cases where such a fix makes sense is probably a small fraction of cases when it would be proposed.

Closing this one as INVALID.