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.
It seems as if parent's cache of children is not updated on MasterFileObject.rename(). This is on NetBeans 4.0 beta 2 (downloaded together with JDK 5.0). To reproduce: 1. Create a new sample project "AnagramGame" (ships with NB). 2. Invoke FileObject.rename() to rename "WordLibrary.java" to "NewName.java". 3. Ask the FO's parent for a child with the old name (f.getParent().getFileObject("WordLibrary", "java")). It must return "null" (no such file exists anymore), but it returns the renamed file instead ("NewName.java"). Here's a BeanShell transcript I used to verify this (where variable "f" is the FileObject for "WordLibrary.java"): bsh % print(f.name); WordLibrary bsh % print(f.getClass()); class org.netbeans.modules.masterfs.MasterFileObject bsh % lock=f.lock(); bsh % f.rename(lock, "NewName", "java"); bsh % lock.releaseLock(); bsh % print(f.name); NewName bsh % print(f.parent.getFileObject("WordLibrary", "java") == f); true
Fixed already with #48348. See commit: /cvs/openide/masterfs/src/org/netbeans/modules/masterfs/Cache.java,v new revision: 1.4; previous revision: 1.3 Verify on latest dev build.
Verified: it's fixed in the dev version (according to my short testing).