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 57729 - Deleted nodes not visible
Summary: Deleted nodes not visible
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 4.x
Hardware: All All
: P2 blocker (vote)
Assignee: rmatous
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2005-04-11 15:07 UTC by kovica
Modified: 2008-12-22 20:57 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The textual patch. (759 bytes, patch)
2005-04-11 18:43 UTC, Martin Entlicher
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description kovica 2005-04-11 15:07:31 UTC
I'm using NB (release41) build 200504101930 and I found out if I delete a class
that is in CVS then I cannot update that class only.
In previous releases (3.6 and 4.0) if you deleted (keyboard DELETE key not CVS
delete action) a class then the class reappeared as a node with CVS status Need
Update.
But In the mentioned release I cannot see that.
Comment 1 Martin Entlicher 2005-04-11 16:36:00 UTC
Yes, this is a regression somewhere. It worked and it ought to work.
Caused by code outside of VCS modules, searching for the reason why it broke...
Comment 2 Martin Entlicher 2005-04-11 17:52:33 UTC
This regression is caused by the fix of issue #56995:
/cvs/openide/masterfs/src/org/netbeans/modules/masterfs/MasterFileObject.java,v
 new revision: 1.41; previous revision: 1.40

Unfortunately, the change does not handle invalid FileObjects correctly:

Here is what happens after a versined file is deleted:

eventFileToMasterFileObject(org.openide.filesystems.FileEvent[source=AbstractFileObject@1cc65b1[file:/home.local/martin/NETBEANS/TEST/CVS_WORK_LOCAL1/testAdd/JavaApplication4/src/javaapplication4/Main_5.java]][file=AbstractFileObject@1cc65b1[file:/home.local/martin/NETBEANS/TEST/CVS_WORK_LOCAL1/testAdd/JavaApplication4/src/javaapplication4/Main_5.java],time=1113237141783,expected=false])
file is virtual = true, is valid = false
  return
MasterFileObject@26ea08[file:/home.local/martin/NETBEANS/TEST/CVS_WORK_LOCAL1/testAdd/JavaApplication4/src/javaapplication4/Main_5.java],
is virtual = true, is valid = false
HACK: dFile =
MasterFileObject@26ea08[file:/home.local/martin/NETBEANS/TEST/CVS_WORK_LOCAL1/testAdd/JavaApplication4/src/javaapplication4/Main_5.java]
eventFileToMasterFileObject(org.openide.filesystems.FileEvent[source=AbstractFileObject@1716fcd[file:/home.local/martin/NETBEANS/TEST/CVS_WORK_LOCAL1/testAdd/JavaApplication4/src/javaapplication4/]][file=AbstractFileObject@1cc65b1[file:/home.local/martin/NETBEANS/TEST/CVS_WORK_LOCAL1/testAdd/JavaApplication4/src/javaapplication4/Main_5.java],time=1113237141783,expected=false])
file is virtual = true, is valid = false
  return
MasterFileObject@26ea08[file:/home.local/martin/NETBEANS/TEST/CVS_WORK_LOCAL1/testAdd/JavaApplication4/src/javaapplication4/Main_5.java],
is virtual = true, is valid = false
fileDeleted(MasterFileObject@26ea08[file:/home.local/martin/NETBEANS/TEST/CVS_WORK_LOCAL1/testAdd/JavaApplication4/src/javaapplication4/Main_5.java]):
org.openide.filesystems.FileEvent[source=MasterFileObject@1d871ab[file:/home.local/martin/NETBEANS/TEST/CVS_WORK_LOCAL1/testAdd/JavaApplication4/src/javaapplication4/]][file=MasterFileObject@26ea08[file:/home.local/martin/NETBEANS/TEST/CVS_WORK_LOCAL1/testAdd/JavaApplication4/src/javaapplication4/Main_5.java],time=1113237141846,expected=false]
HACK: dFile =
MasterFileObject@26ea08[file:/home.local/martin/NETBEANS/TEST/CVS_WORK_LOCAL1/testAdd/JavaApplication4/src/javaapplication4/Main_5.java]
eventFileToMasterFileObject(org.openide.filesystems.FileEvent[source=AbstractFileObject@1716fcd[file:/home.local/martin/NETBEANS/TEST/CVS_WORK_LOCAL1/testAdd/JavaApplication4/src/javaapplication4/]][file=AbstractFileObject@16aee91[file:/home.local/martin/NETBEANS/TEST/CVS_WORK_LOCAL1/testAdd/JavaApplication4/src/javaapplication4/Main_5.java],time=1113237142603,expected=false])
file is virtual = true, is valid = true
  return
MasterFileObject@26ea08[file:/home.local/martin/NETBEANS/TEST/CVS_WORK_LOCAL1/testAdd/JavaApplication4/src/javaapplication4/Main_5.java],
is virtual = true, is valid = false


The problem is in the last call, where for a new valid AFO (which was created
after the old deleted file was invalidated), we get an invalid MFO.

It needs to be modified to handle invalid files correctly.

Will attach a new patch....
Comment 3 Martin Entlicher 2005-04-11 18:43:44 UTC
Created attachment 21555 [details]
The textual patch.
Comment 4 Martin Entlicher 2005-04-11 18:46:52 UTC
The attached patch is trivial and should be safe. Added check for FileObject
validity so that it's assured that we do not get invalid MFO for valid AFO.
The fix should go into 4.1, adding appropriate keyword.

Comment 5 rmatous 2005-04-12 16:25:10 UTC
/cvs/openide/masterfs/src/org/netbeans/modules/masterfs/MasterFileObject.java
new revision: 1.42; previous revision: 1.41
Comment 6 Martin Entlicher 2005-04-13 16:34:49 UTC
The diff reviewed, the change is safe.
I've verified that it solves the problem.
Comment 7 rmatous 2005-04-13 16:59:16 UTC
/cvs/openide/masterfs/src/org/netbeans/modules/masterfs/MasterFileObject.java
new revision: 1.41.2.1; previous revision: 1.41
Comment 8 rmatous 2005-04-13 16:59:40 UTC
Fixed into release41.