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.
NB200405182245 JDK 1.4.2 Steps to reproduce: I create a MyCollectionTest junit class in TestPackage. It contains the following code: public class MyCollectionTest extends TestCase { private MyCollection collection; protected void setUp() { collection = new MyCollection(); } public MyCollectionTest(java.lang.String testName) { super(testName); } public static Test suite() { TestSuite suite = new TestSuite(MyCollectionTest.class); return suite; } public void testAddString() { assertTrue(collection.isEmpty()); assertEquals(0, collection.size()); assertTrue(!collection.containsString("string1"); collection.addString("string1"); assertTrue(!collection.isEmpty()); } Lines private MyCollection collection; collection = new MyCollection(); collection.isEmpty() collection.size() collection.containsString() collection.addString() have a java annotation Cannot resolve symbol MyCollection. Now, I will create the class MyCollection in the Source Packages, in the same package as the MyCollectionTest After creation of MyCollection, I switch back to MyCollectionTest, and only those two following lines are now in error: private MyCollection collection; collection = new MyCollection(); Other ones are not any more marked as in error. Now, I do the following: delete the line private MyCollection collection; retype private MyCol| press Ctrl-Space NB propose MyCollection I introduced collection; And I finally have the same line private MyCollection collection; but always marked as in error. I select MyCollection, press Alt-Shift-I to do the import. NB confirm that MyCollection is well in the same package than MyCollectionTest by adding no import sentence. I do Clean and Build. MyCollection is now marked as compiled. and no more Java Error Annotation appears in the class MyCollectionTest.
Assigning to java module. 2 major points from the report: a) both classes are from the same package, but they are stored in different locations (TestPackage, Source Packages) b) Clean/Build helped
*** This issue has been marked as a duplicate of 41630 ***
Reopening - was marked as a duplicate by mistake.
This works for me in current builds. Please remember that: - if you add something to a file, you need to save the file before it is visible to other files (otherwise you will get error annotation that the added construct is missing) - you need to edit the file in order to get the error annotations refreshed