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.
This bug has been created in relation to the issue 155567, comment 6. In some cases there is a problem with Fix Imports action. Configuration: - Create Maven based project - Add JUnit 4.10 dependency in pom.xml (you should seen it in the Test Dependencies node) - Create Groovy file with a following content: class MyGroovyTest { @Test void succeed() { Assert.assertEquals(4, 2+2); } } - Use Fix Imports action --> org.junit.Assert isn't imported at all and there isn't correct org.juni.Test import as well (only different Test types are offered) ..might be related to annotation + static methods, but can't say for sure now - have to investigate a little bit more
One more case: fix import suggestion doesn't appear on Whatever.class either. So issue is not specific to static methods only. Also these problems are not marked as issues in the editor.
I just stumbled on an annoying bug with the 'fix imports' functionality: it doesn't know about java's own classes! I tried with java.sql, java.io and java.util classes, it didn't find any them. Some classes I tried with: ResultSet, Connection, ArrayList, IOException. It seems to work with the other non-jdk classes though: I made a test and removed all the import rows of my class, and then pressed ctrl+shift+I, all the other classes were found except those that are part of jdk, in those rows "<cannot be resolved>" message is shown. Is this the same bug as this one?
Not really. Could you please open another ticket with the same description?
Ok, I did that. It is now ticket #216913.
Mm, the issue 216913 was created for java. Do you have those troubles on groovy files or on java files? Thanks in advance
Most of the issue fixed in: web-main #7a2b2b48990e One thing that remain is that Assert is not recognized by editor (resp. groovy parser) as a incorrect line and thus the import mechanism isn't looking for Assert in source and compilation classpath. I'm going to fill another issue to track this. Anyway imports should work correctly now for everything that is marked as incorrect line..
I have created issue 226016 to track the problem with parsing groovy file
Integrated into 'main-golden', will be available in build *201302122300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/7a2b2b48990e User: Martin Janicek <mjanicek@netbeans.org> Log: #213297 - Using Fix import doesnt work correctly in some cases