Bug 572249 - Cleanup "Use switch instead if-else-if chain" fails when comments are present
Summary: Cleanup "Use switch instead if-else-if chain" fails when comments are present
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.20   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Fabrice Tiercelin CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-24 04:17 EDT by Andy Man CLA
Modified: 2023-06-23 17:00 EDT (History)
2 users (show)

See Also:


Attachments
cleanup settings (8.28 KB, text/xml)
2021-03-24 04:17 EDT, Andy Man CLA
no flags Details
The minimal example to reproduce the bug (2.73 KB, application/x-zip-compressed)
2021-03-24 04:17 EDT, Andy Man CLA
no flags Details
stack trace of exception during clean up (17.62 KB, text/plain)
2021-03-24 04:17 EDT, Andy Man CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Man CLA 2021-03-24 04:17:07 EDT
Created attachment 285934 [details]
cleanup settings

Whenever a comment is present in an if-else-if chain the auto refactoring which turns these into a switch fails with an exception, preventing cleanup completely.

I attached a minimal example project.
Comment 1 Andy Man CLA 2021-03-24 04:17:31 EDT
Created attachment 285935 [details]
The minimal example to reproduce the bug
Comment 2 Andy Man CLA 2021-03-24 04:17:43 EDT
Created attachment 285936 [details]
stack trace of exception during clean up
Comment 3 Kalyan Prasad Tatavarthi CLA 2021-03-24 05:17:37 EDT
The cleanup issue is happening due to 'cleanup.switch' option being set to true.

In UI it is "Convert if/else if/else chain to switch".
Comment 4 Eclipse Genie CLA 2023-06-23 17:00:57 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.