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 46524 - Empty sibling packages deleted when deleting package
Summary: Empty sibling packages deleted when deleting package
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 4.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: Petr Hrebejk
URL:
Keywords:
: 46799 (view as bug list)
Depends on:
Blocks: 41535
  Show dependency tree
 
Reported: 2004-07-24 18:39 UTC by Jesse Glick
Modified: 2004-08-13 12:11 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 Jesse Glick 2004-07-24 18:39:57 UTC
Originally mentioned in issue #46510. Create an
empty j2seproject and packages "a.b" and "a.c".
Delete a.b. a.c is removed as well, which doesn't
make any sense. (a.c is not removed if there are
any files in it.)

Problem is in misuse of isEmpty to determine
whether to delete the next parent package in
PackageNode.destroy; should only delete the parent
if it is really empty, i.e. getChildren().length == 0.

Also PackageViewTest does not cover
PackageNode.destroy at all, which is a serious
omission.
Comment 1 Milan Kubec 2004-07-26 08:20:16 UTC
IMO this bug should be fixed to promo-D. It's really serious
misbehavior when deleting one package deletes also another (sibling)
package even when it's empty.
Comment 2 Petr Hrebejk 2004-07-27 10:13:49 UTC
Should be fixed. (not (ab)using isEmpty() ) Testcase added.

Checking in
project/src/org/netbeans/spi/java/project/support/ui/PackageViewChildren.java;
/cvs/java/project/src/org/netbeans/spi/java/project/support/ui/PackageViewChildren.java,v
 <--  PackageViewChildren.javanew revision: 1.22; previous revision: 1.21
done
Processing log script arguments...
More commits to come...
Checking in
project/test/unit/src/org/netbeans/spi/java/project/support/ui/PackageViewTest.java;
/cvs/java/project/test/unit/src/org/netbeans/spi/java/project/support/ui/PackageViewTest.java,v
 <--  PackageViewTest.java
new revision: 1.8; previous revision: 1.7
done
Comment 3 Jesse Glick 2004-07-30 21:10:34 UTC
*** Issue 46799 has been marked as a duplicate of this issue. ***
Comment 4 _ ttran 2004-07-31 12:55:28 UTC
*** Issue 46799 has been marked as a duplicate of this issue. ***