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.
I am attaching a test case which demonstrates the problem when executing on FFJ 4.0 fcs (NB 3.3.2). The basic problem is the following code will sometimes return an invalid data object. DataObject dobj = // get data object; FileObject fo = dobj.getPrimaryFile(); dobj.setValid(false); DataObject ido = DataObject.find(fo); // sometimes ido.isValid() == false;
Created attachment 5630 [details] Java File demonstrating the problem
In order to demonstrate this bug do the following using the attached file. 1. mount or create directory containing this java file, this may require adjusting the class path. 2. add another file jdotest_1.java to the same directory or adjust the FileObject.find statement to refer to a compiled java file. 3. Use Internal compilation and execution. 4. If the finding statement appears in the output window this means that DataObject.find has returned an invalid data object and the bug has been triggered.
Increasing priority it causes problem in winsys when opening new project. I will try workaround not to chack DO validity after it is created but it can be potentialy dangerous because it can hide another problems. In winsys we just create primary file and use DataObject.find(). Returned DO is not valid sometimes. Reproducible with currect dev build 20020211. Start new IDE open any txt file and open new project. Problem appears on Solaris, JDK 1.4.0-b92 quite often. (Not always.) I can provide more info where it happens in our code. Result is that we throw FileNotFoundException.
Fixed in trunk. I am going to add the test to /openide/test/ Chris, thanks for the excelent bug report.
[200307040100]verified