| Summary: | Organize imports changes static imports to .* even when that introduces compile errors | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Jorn Hertsig <jorn86> |
| Component: | Core | Assignee: | John Glassmyer <eclipse> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | eclipse.sprigogin, jorn86, markus.kell.r, remy.suen, satyam.kandula, shankhba |
| Version: | 3.7 | ||
| Target Milestone: | 4.5 M6 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 430303 | ||
Java tooling bugs go to JDT. Thanks for moving this to the correct product, but is someone going to take a look at it? I confirm that this is a bug which needs to be fixed. However, we may not be able to look at this right now. Please feel free to contribute a patch. Fixed via bug 430303. Verified for 4.5 M6 with build I20150316-2000 |
Build Identifier: I20110613-1736 I have two enums with similarly named fields: enum Horizontal {TOP, CENTER, BOTTOM} enum Vertical {LEFT, CENTER, RIGHT} I have code that uses them like this: import Horizontal.TOP; import Vertical.CENTER; // in some method setAlignment(TOP, CENTER); I have the organize imports action configured to replace static imports with .* whenever there's 1 or more. (Window menu -> Preferences -> Java -> Code Style -> Organize Imports -> Number of static imports needed for .* = 1) Now, organizing imports will change the imports to: import Horizontal.*; import Vertical.*; Since Horizontal also offers a CENTER constant, my method call no longer compiles, since it expects an instance of Horizontal and one of Vertical, and it now gets two of Horizontal. Reproducible: Always Steps to Reproduce: 1. Organize imports in code and settings as described above