Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 330202

Summary: [quick fix] Add quick fix to increment subsequent values in case statements when a duplicate exists
Product: [Eclipse Project] JDT Reporter: Pawel Pogorzelski <pawel.pogorzelski1>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert
Version: 3.6.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

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.