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 48980 - Invisible files force a package to remain visible
Summary: Invisible files force a package to remain visible
Status: RESOLVED DUPLICATE of bug 49169
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Petr Hrebejk
Depends on:
Blocks: 41535
  Show dependency tree
Reported: 2004-09-14 05:32 UTC by _ gtzabari
Modified: 2004-10-11 13:43 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2004-09-14 05:32:42 UTC
dev build 200409121800
JDK 1.5 RC

I create a new package, move my classes from the
old one into the new one and try deleting the old
one. The operations seems to succeed (Netbeans
gives no errors) but the package is left behind
and not removed.
Comment 1 _ gtzabari 2004-09-14 05:50:11 UTC
Here is some more information that should help you track down this bug.

My project has two packages:


- I've moved my classes from A to A.B and I'm trying to remove A
- A contains a subdirectory CVS and B and for obvious reasons I cannot
remove either but I expect Netbeans' UI to let me remove the package
node, regardless of whether it has these directories in it or not.
Comment 2 Milan Kubec 2004-09-14 09:20:28 UTC
Reassigning for evaluation.
Comment 3 Jan Becicka 2004-09-14 10:11:13 UTC
Java/project should be responsible for this.
Comment 4 Jesse Glick 2004-09-14 18:51:52 UTC
Can't reproduce in 040910 custom on Linux + JDK 1.5. Make folders
$p/src/a/CVS and $p/src/a/b/CVS. Package view correctly shows just
"a.b" (empty). Make in $p/src/a/. Package view now shows also
"a" (not empty). Select, Refactor -> Move, move into a.b. Now
package view shows just "a.b" (not empty, is in it).

In general, a package is displayed if and only if the corresponding
folder exists, and is either completely empty (excepting ignorable
files/folders like CVS), or contains (non-ignorable) files, but not if
it contains folders and no files.
Comment 5 _ gtzabari 2004-09-14 19:09:47 UTC

This issue is reported against WindowsXP, not Linux. Can someone
please try reproducing on the aforementioned platform before closing
as WORKSFORME? I've reproduced two similar problems (inability to
remove default package, and custom package) on two separate builds and
both times people said it worked for them. In both cases I used a
fresh installation. I highly doubt I am imagining things across
different builds/configurations :) We just need to find a way to
reproduce it on your end.
Comment 6 Jesse Glick 2004-09-14 19:34:58 UTC
Comment 7 Jesse Glick 2004-09-14 19:36:56 UTC
Will see if Milan can reproduce on Windows. Don't know of any reason
why this would differ on Windows, but it could.

In the meantime, please attach the most specific steps to reproduce
that you can - we need to be able to exactly mimic the environment you
have, starting from scratch. The problem probably lies in some
background detail you did not mention yet.
Comment 8 Milan Kubec 2004-09-15 12:50:34 UTC
Works for me the same way as for Jesse. package 'a' has been removed
from the view as soon as I moved the class to 'a.b' package. I tried
on WinXP, JDK 1.5.0 RC.

Please try to exactly describe steps you do.
Comment 9 _ gtzabari 2004-09-15 14:44:34 UTC

I guess the problem is that for me moving the classes did not succeed
completely. I got a bunch of exceptions (which I reported in another
issue) and then proceeded to try changing the package names and
deleting the old package myself and then I ran into this issue. I will
retry it with the latest build and report back.
Comment 10 _ gtzabari 2004-09-24 18:53:41 UTC
Ok, even with the latest build this does not work. I move a bunch of
classes into a sub-package but the parent package still contains "CVS"
(no other files or directories, except the sub-package).

I even went as far as restarting Netbeans and trying to remove the
parent package from the GUI and it stills fails.
Comment 11 Jesse Glick 2004-09-24 23:42:23 UTC
Well unless someone on the NB team can reproduce it, you're probably
going to have to debug it yourself, because I can't even guess what
might be happening differently on your machine.

Again, if (1) there no files in the parent package except subpackages
and CVS/ dirs, and (2) there is at least one subpackage, then it
should never appear in the GUI. If you get to the state where (1) and
(2) are true but it does appear in the GUI, something is broken, so
try to figure very carefully how to reproduce it; don't bother looking
for other things to break.

BTW the java/project module handles this stuff - PackageViewChildren.
Comment 12 _ gtzabari 2004-09-28 17:48:00 UTC
Ah ha! I cracked it!

The reason I cannot remove the parent package is because the
Versioning tab showed two files as "Needs update". That is, two
virtual files. Now, it actually turns out that once you do a CVS |
Refresh that its cache was wrong and those files were no longer in CVS
(they had been removed). Once the refresh completes, the parent
package disappeared automatically.

This is a bad usability issue in my view. The parent package should
not display unless there are visible nodes inside it. Since you guys
chose to make virtual VCS files not visible in the project-view, they
should not cause the parent package to display.
Comment 13 Jesse Glick 2004-09-29 14:14:09 UTC
First, I would recommend you configure your CVS mount to hide virtual
files. More trouble than good, IMHO.

One problem can easily be reproduced without any reference to CVS, at
least in 040923 on Linux. Just create a j2seproject with a main class
in package a. Close it. On disk, create another package b with an
invisible file in it, e.g.

$ mkdir $proj/src/b
$ touch $proj/src/b/

Now reopen the project. The package 'b' is shown, which is correct,
but it is shown with the full icon, not the empty icon. However if you

$ mkdir $proj/src/b/c

then only a and b.c are shown, not b.

I don't know if this is the problem Gili was referring to. If not,
Gili please provide exact steps to reproduce the problem you do have.
Comment 14 _ gtzabari 2004-09-29 14:54:33 UTC

This is a different issue than the one I am reporting, although
probably related. In my case:

1) You have package A which you have CVS files checked into. Package A
displays as full and you can see files inside it in the Projects tab.
2) Create package A.B which is not checked into CVS. Move all the
files from Package A to package A.B
3) In the Projects view you will see full packages A and A.B even
though package A is really empty. Going into the Versioning tab you
will see virtual files under A with the state "Needs update".
Comment 15 Jesse Glick 2004-09-29 18:19:55 UTC
Please clarify point #3.

"In the Projects view you will see full packages A and A.B even though
package A is really empty." - you mean A shows as a full icon but has
no children, or it really shows children underneath it? If the former,
then I cannot reproduce it using e.g. *~ files, maybe someone else can.

"Going into the Versioning tab you will see virtual files under A with
the state "Needs update"." - and do these appear for you in the
Projects tab? or the Files tab?
Comment 16 _ gtzabari 2004-09-29 18:32:01 UTC
I see a full package icon but not children.

I don't think CVS virtual files are equivilent to *~ files (correct me
if I'm wrong). If you following my repro steps exactly (using CVS
instead of 'touch' to create temporary files) you should be able to
get it on your end.

On the topic of virtual files, they are *not* visible in the Projects
tab. I did not check the Files tab but I don't think that it really
makes a difference. The key is that if the package node contains no
children it should not show up using the full package icon. Further, I
should be able to remove it from the Projects tab since (from my point
of view) it doesn't contain any physical files.

Alternatively, you can display these virtual files in the Package tab
so I at least understand why the package is being shown using the full
icon and can act on it.
Comment 17 Jesse Glick 2004-09-30 12:52:16 UTC
So the rule is that the package should disappear unless it has no
subpackages or it has some *visible* children. CVS/ subdirs definitely
count as visible children. I don't know if virtual files, if they are
not suppressed completely (as it sounds like they are in your case -
configurable option) count as visible or not - probably they do count
as visible. In any case, if you see a "full" package icon with nothing
beneath it, or an "empty" package icon with nothing beneath it but
some subpackage is being displayed, there is a bug in the package
view. Hopefully Petr can reproduce & fix.
Comment 18 _ gtzabari 2004-09-30 17:57:47 UTC
What did you mean by "CVS/ subdirs definitely count as visible
children"? I thought we agreed they do not :)

And yeah, the current behavior is definately a bug.
Comment 19 Jesse Glick 2004-10-04 17:18:16 UTC
Sorry, I meant that CVS/ subfolders definitely count as *invisible*
Comment 20 Petr Hrebejk 2004-10-11 13:40:27 UTC
Jesse's usecase is a bit different. I've created another bug for it.
See issue #50221
Comment 21 Petr Hrebejk 2004-10-11 13:43:33 UTC
Yes, I was able to reproduce the bug Gili is reporting. 
However it resolved in beeing a problem in behavior of the VCS virtual
files, which was recently fixed by Radek Matous. In the latest builds
you should see the virtual files in the project's tab. (Unless you
switch it off in the VCS mount properies - then  the folder should

*** This issue has been marked as a duplicate of 49169 ***