| Summary: | [extract method] Refactor > Extract Method with break statement in switch causes NPE | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Shawn Lauzon <s_lauzon> | ||||
| Component: | UI | Assignee: | Markus Keller <markus.kell.r> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | amj87.iitr, daniel_megert | ||||
| Version: | 3.6 | ||||||
| Target Milestone: | 3.8 M7 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 200107 [details]
Stack dump
Moving to JDT/UI Used to work but got broken during 3.6. |
Build Identifier: 20110615-0604 If I attempt to Refactor > Extract Method which includes a break statement inside a switch, an unexpected exception occurs, which is an NPE (will attach stack later). It should give an error which says something like you can't refactor a method which includes multiple exit points, or something like that. Reproducible: Always Steps to Reproduce: 1. Write some code: public void foo(int i) { switch (i) { case 1: if (true) { break; } } } 2. Highlight the some code within the case 1 statement. 3. Choose Refactor > Extract Method