| Summary: | [generate constructor] generate constructor using fields incorrectly adds imports [code generation] | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Philip Mayer <eclipsetalk2> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | daniel_megert |
| Version: | 3.2 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | stalebug | ||
Still an issue in I20100128-1731. 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. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. 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. |
Suppose you have a class A in a package p with two fields; the first typed with q.B (qualified), and the second with B from package p (unqualified): ---- package p; public class A { q.B field1; B field2; } ---- Generate Constructor using fields adds an import for q.B, leading to the following code with compile errors: ---- package p; import q.B; public class A { q.B field1; B field2; /** * @param field1 * @param field2 */ public A(B field1, p.B field2) { super(); // TODO Auto-generated constructor stub this.field1 = field1; this.field2 = field2; } } ---- field2 is now typed with "q.B", and the assignment fails.