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.
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.
Here is some more information that should help you track down this bug. My project has two packages: A A.B - 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.
Reassigning for evaluation.
Java/project should be responsible for this.
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 X.java in $p/src/a/. Package view now shows also "a" (not empty). Select X.java, Refactor -> Move, move into a.b. Now package view shows just "a.b" (not empty, X.java 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.
Jesse, 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.
x
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.
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.
Milan, 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.
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.
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.
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.
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/Hello.java~ 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.
Jesse, 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".
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?
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.
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.
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.
Sorry, I meant that CVS/ subfolders definitely count as *invisible* children.
Jesse's usecase is a bit different. I've created another bug for it. See issue #50221
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 disapear) *** This issue has been marked as a duplicate of 49169 ***