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.
Hi, I have a suggestion how to improve guesstimation what to import. It's simple: Prefer classes from packages which are already used. Example: private static final Logger log = LoggerFactory.getLogger(JUnitDiffApp.class); Now I have slf4j and java.util.logging on classpath. I start with LoggerFactory - Alt + Enter. NetBeans offers packages in alphabetical order. I choose slf4j. NetBeans adds import org.slf4j.LoggerFactory; Now when I press Alt + Enter the line with Logger, NetBeans could guess that it's import org.slf4j.Logger; to be imported since org.slf4j is already used. Small improvement, but that's the kind of things which make NetBeans so smooth to work with. Thanks for considering. (PS: I've tried 7.0 nightly and it was pretty stable, and somehow it feels like working more fluently, with background tasks being done without slowing the IDE... Good work!)
Known type information should also be used. E.g.: import org.slf4j.LoggerFactory; static Logger log = LoggerFactory.getLogger( WicketApplication.class ); ~~~~~~ Now Ctrl+Shift+I suggests java.util.logging.Logger, even if it's clear that I want to import slf4j's Logger.
Addition: It's highly improbable that anyone wants to use java.swing.* in a web application. Thus, for WARs, this can be completely omitted. In general, I'd solve this by 1) Keeping statistics of the classes used in given project and sorting accordingly 2) Favoring dependencies over JDK 3) Perhaps by a project-specific black-list. BTW this could also affect default "enclose in try block" hint around uncaught exceptions, which currently abruptly imports java.util.logging.
Ad 3) in #2, I found that Options > Editor > Code Completion already has a blacklist. But that's not project specific. I will now blacklist Swing, then remove it when I switch to work on other project? ...
This seems to be a bit improved in 7.3.beta2.