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.

Bug 50326 - Parent's cache of children not updated on MasterFileObject.rename()
Summary: Parent's cache of children not updated on MasterFileObject.rename()
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 4.x
Hardware: PC Linux
: P1 blocker (vote)
Assignee: rmatous
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-13 12:21 UTC by risto09q894
Modified: 2008-12-22 17:01 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description risto09q894 2004-10-13 12:21:15 UTC
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
Comment 1 rmatous 2004-10-14 07:32:28 UTC
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.

Comment 2 risto09q894 2004-10-14 17:06:16 UTC
Verified: it's fixed in the dev version (according to my short testing).