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 66669 - "Fix Imports" does not add static imports
Summary: "Fix Imports" does not add static imports
Status: RESOLVED DUPLICATE of bug 89258
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-13 00:45 UTC by Kirill Sorokin
Modified: 2009-10-19 11:19 UTC (History)
0 users

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 Kirill Sorokin 2005-10-13 00:45:51 UTC
The "Fix Imports" feature does not support static imports, i.e. importing static
class fields to be referenced directly. (e.g. 
  
   import static ru.ksorokin.kobold.util.string.StringConstants.CRLF;
)

It would be nice to have keeping in mind java 1.5 compliance.
Comment 1 jmcmilla 2005-11-18 10:56:37 UTC
Just to add to this, the current Fix Imports in NetBeans 5.0 Beta 2, static
imports are imported, but without the "import static" (it just has "import"). If
there is already an "import static" for the import, then that is ignored and the
same import with just "import" is added.

e.g.

import static ru.ksorokin.kobold.util.string.StringConstants.CRLF;

becomes

import static ru.ksorokin.kobold.util.string.StringConstants.CRLF;
import ru.ksorokin.kobold.util.string.StringConstants.CRLF;
Comment 2 Daniel Prusa 2005-11-21 09:37:43 UTC
Fix Imports in NB 5.0 does not handle static imports. Adding of imports like

import static ru.ksorokin.kobold.util.string.StringConstants.CRLF;

is not supported and this import should not be generated by the action. If you
have a test case for which this occurs, file a new issue and attach sources
allowing to reproduce it, please.
Comment 3 Jiri Prox 2009-10-19 11:19:27 UTC

*** This issue has been marked as a duplicate of 89258 ***