| Summary: | [extract local] generates bad import for expressions returning a nested type | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Chris West (Faux) <eclipse> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | RESOLVED WORKSFORME | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | daniel_megert, markus.kell.r |
| Version: | 3.6 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows Vista | ||
| Whiteboard: | |||
Works for me using latest builds, e.g. N20100505-2000. Please reopen if you still see this with said build and provide more steps. Note that we fixed a few bug in that area recently, so it's well possible that this really failed in I20100413-1521. Yeah, I can't reproduce in I20100506-0800. Well played. |
Build Identifier: I20100413-1521 Attempting to "Extract local variable" from "Bar.b" or "Bar.class" generates an illegal import for "Scratch.Bar". This is caught at the preview stage. Doesn't happen with static field or method access? class Scratch { static class Bar { static Bar b = new Bar(); } void foo() { System.out.println(Bar.b); System.out.println(Bar.class); } } Generated code is fine apart from the import. Same issue as bug 304827? Reproducible: Always Steps to Reproduce: 1. Create the class above. 2. Hilight "Bar.class" or "Bar.b". 3. alt+shift+l / alt+shift+t / right-click refactor -> Extract Local Variable. 4. Accept name. 5. Error detected at Preview step.