| Summary: | [refactor] Import static doesn't work when static method is referenced from subtype | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Lukas Eder <lukas.eder> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | fabian.pfaff, gautier.desaintmartinlacaze, jjohnstn, noopur_gupta |
| Version: | 3.8.1 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | stalebug | ||
Reproducible in Eclipse 3.8.1 also. 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. The issue still persists 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. Fixed in 4.26 M3. |
Consider the following classes: ------------------------------------------------------------ package x; public class A { public static void m() {} } ------------------------------------------------------------ package x; public class B extends A { } ------------------------------------------------------------ import x.B; public class Test { void x() { B.m(); } } ------------------------------------------------------------ I want to be able to click on "m()" and static-import the method via Ctrl+Shift+M or "Right click > Source > Add Import". If I do this, nothing happens. If I do Ctrl+Shift+M on "m()" in the following class, it works: ------------------------------------------------------------ import static x.A.m; public class Test { void x() { m(); } } ------------------------------------------------------------