| Summary: | [quick fix] guess type parameter from usage | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Larry Edelstein <ribs> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | minor | ||
| Priority: | P3 | CC: | eclipse |
| Version: | 3.2 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | stalebug | ||
Move to JDT/UI The feature that provides the error resolution is not content assist, but quick fix. Moving back to jdt-ui. 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. |
If you type an invocation like "listeners.add(listener)" and you don't have a "listeners" variable, content assist is smart enough to guess that "listeners" should be a collection, and will create a Set for you, which is nice. However, it seems to use the (top-most) enclosing class type as the type argument for the Set, but it should use the type of the parameter in the invocation. For example, if you typed this: class Foo { public void addListener(FooListener listener) { listeners.add(listener); } } ...the compiler would flag "listeners" as an error, and content assist would offer to create Set<Foo> listeners; instead of Set<FooListener> listeners; That's all.