This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Fix Imports should use context clues to determine imports | ||
---|---|---|---|
Product: | java | Reporter: | Petr Hrebejk <phrebejk> |
Component: | Source | Assignee: | Svata Dedic <sdedic> |
Status: | NEW --- | ||
Severity: | blocker | CC: | malfunction84, tboudreau |
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
Petr Hrebejk
2006-09-27 22:36:00 UTC
Overtake. Fix Imports could take into account other things too, like assignment to/from other known types, and whether the type is being used as an annotation. - Method invocations: unknownType.doSomething(); // only suggest types which have a doSomething() method. - Assignments from known subtypes: UnknownType u = (KnownType) map.get(key); // only suggest types which KnownType extends or implements - Assignments to known supertypes: KnownType k = (UnknownType) map.get(key); // only suggest types which extend or implement KnownType - Annotations: @UnknownType private int i; // only suggest types which are annotations that can be applied to fields So basically, it should only offer suggestions that will compile cleanly. The dialog's appearance can still be based off the number of matches: - If only one type works, it should automatically import that type. - If multiple types work, it should offer them in the Fix Imports dialog. - If no types work, then it should match on class names only (current behavior) and offer them in the Fix Imports dialog. *** Issue 140522 has been marked as a duplicate of this issue. *** *** Issue 130115 has been marked as a duplicate of this issue. *** Resetting assignee to default for all bugs reported against product java and assigned to moonko. |