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.
Steps to reproduce: Set up: installed build 061002_2 on WindowXP having JDK 1.5.0_09 1. create and run a test which will give you a result. 2. rename the test to something else 3. the results will magically disappear 4. rename the test back to its original name 5. the results will magically reappear
Created attachment 34846 [details] video showcasing the bug
Fixed in release55_dev. Please let me know if this is a must-fix for release55.
Patch attached to a mail sent to reviewers@netbeans.org is bad. FileLock needs to be released in finally block. Especially if it seems to be likely that there can be problem with performing I/O. BTW: read http://www.netbeans.org/community/releases/55/high-resistance.html to find that you should attach patch here. Why are you asking for review if you are not sure if you want to commit your change.
Thanks a lot for the review. The problem has been corrected. I think I missed the status whiteboard keyword when I checked the original fix into release55_dev. The following is the final cvs diff: C:\nb_all\enterprise\compapp\projects\jbi\src\org\netbeans\modules\compapp\test\ui>cvs diff -c -u -r 1.1.2.26 -r 1.1.2.26.2.2 TestcaseNode.java Index: TestcaseNode.java =================================================================== RCS file: /cvs/enterprise/compapp/projects/jbi/src/org/netbeans/modules/compapp/test/ui/Attic/TestcaseNode.java,v retrieving revision 1.1.2.26 retrieving revision 1.1.2.26.2.2 diff -c -u -r1.1.2.26 -r1.1.2.26.2.2 cvs server: conflicting specifications of output style --- TestcaseNode.java 22 Sep 2006 04:48:19 -0000 1.1.2.26 +++ TestcaseNode.java 6 Oct 2006 01:49:31 -0000 1.1.2.26.2.2 @@ -45,6 +45,7 @@ import org.openide.filesystems.FileChangeAdapter; import org.openide.filesystems.FileChangeListener; import org.openide.filesystems.FileEvent; +import org.openide.filesystems.FileLock; import org.openide.filesystems.FileObject; import org.openide.filesystems.FileRenameEvent; import org.openide.filesystems.FileUtil; @@ -244,6 +245,33 @@ mChildren = (TestcaseChildren) getChildren(); } + public void setName(String name) { + String oldName = getName(); + + super.setName(name); + + if (getName().equals(name)) { + // if successful, we also need to update test case results + // directory name + FileLock fileLock = null; + try { + fileLock = mTestCaseResultsDir.lock(); + mTestCaseResultsDir.rename(fileLock, name, null); + } catch (IOException ex) { + // revert back + super.setName(oldName); + + NotifyDescriptor d1 = new NotifyDescriptor.Message(ex.getMessage(), + NotifyDescriptor.WARNING_MESSAGE); + DialogDisplayer.getDefault().notify(d1); + } finally { + if (fileLock != null) { + fileLock.releaseLock(); + } + } + } + } + private void registerPropertyFileChangeListener(final FileObject testcaseDir) { List specList = new ArrayList();
Fixed in release55_dev.
> I have updated http://www.netbeans.org/issues/show_bug.cgi?id=86423 > with the new fix. Please let me know if you will be reviewing it again > or should I resent it the reviewer mailing list. > I'd say it is not needed to resend it. Personally I do not have more comments. -Radim
Fix checked into release55.
This fix is not in milestone22, will wait for the next build.
Verified that after I rename a testcase, the results still remain under the folder. milestone22