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.

Bug 71249 - Fix Imports does not offer to create static imports
Summary: Fix Imports does not offer to create static imports
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Dusan Balek
URL:
Keywords:
: 128286 144254 164490 172243 186381 (view as bug list)
Depends on: 89258
Blocks:
  Show dependency tree
 
Reported: 2006-01-10 20:12 UTC by Jesse Glick
Modified: 2016-06-27 10:36 UTC (History)
4 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2006-01-10 20:12:08 UTC
@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.
Comment 1 Jesse Glick 2006-01-10 20:12:22 UTC
Ditto for editor hints, BTW.
Comment 2 Dusan Balek 2006-10-26 10:40:23 UTC
Reassigning to Honza.
Comment 3 Jan Lahoda 2006-12-14 08:24:53 UTC
Sorry, but I do not think this is a defect - this is not supposed to work for now.
Comment 4 Jiri Prox 2008-08-19 10:08:20 UTC
*** Issue 144254 has been marked as a duplicate of this issue. ***
Comment 5 Jiri Prox 2009-09-15 10:14:55 UTC
*** Issue 172243 has been marked as a duplicate of this issue. ***
Comment 6 Jan Lahoda 2009-12-04 05:35:10 UTC
*** Bug 164490 has been marked as a duplicate of this bug. ***
Comment 7 fommil 2009-12-05 05:19:02 UTC
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.*).
Comment 8 Jan Lahoda 2010-05-19 15:09:56 UTC
*** Bug 186381 has been marked as a duplicate of this bug. ***
Comment 9 Jesse Glick 2011-10-19 15:37:15 UTC
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).
Comment 10 markiewb 2015-04-16 20:14:26 UTC
*** Bug 128286 has been marked as a duplicate of this bug. ***
Comment 11 _ gtzabari 2015-06-11 22:34:55 UTC
Dusan,

Please update Target Milestone.
Comment 12 _ gtzabari 2016-06-26 04:53:35 UTC
Can this issue be closed in favor of bug #89258?
Comment 13 Dusan Balek 2016-06-27 10:36:31 UTC
Yes, already fixed.