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.
@Retention(RUNTIME) @Target({FIELD}) public @interface X {} Fix Imports will offer to import Retention and Target, but not (static import) ElementType.FIELD and RetentionPolicy.RUNTIME.
Ditto for editor hints, BTW.
Reassigning to Honza.
Sorry, but I do not think this is a defect - this is not supposed to work for now.
*** Issue 144254 has been marked as a duplicate of this issue. ***
*** Issue 172243 has been marked as a duplicate of this issue. ***
*** Bug 164490 has been marked as a duplicate of this bug. ***
Pulling in clarifying comments from dupes. Note that this is related to issue 164487. Instead of scanning the entire classpath, the user provides the list of classes to scan. There could be a lot of noise without user preference. (copied from gsporar in issue 89258) If I type this in: int val = abs(55); I get an error and an editor hint that offers to create a method called abs(). I would like to also get an editor hint that offers to do a static import of java.lang.Math.abs (and perhaps another hint for a static import of java.lang.Math.*).
*** Bug 186381 has been marked as a duplicate of this bug. ***
Partially addressed in 7.1, though not my original use case. "Members Count To Use Static Star Import" seems to have no effect on the sample code (Logger.SEVERE never replaced with SEVERE). Anyway I would not necessarily want this for everything, mainly for enums; not clear if "Packages To Use Star Import" can include types for static star import, and there is no option to configure it separately for enums (or compile-time constants).
*** Bug 128286 has been marked as a duplicate of this bug. ***
Dusan, Please update Target Milestone.
Can this issue be closed in favor of bug #89258?
Yes, already fixed.