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 29480 - "new package" action sometimes creates a new Java Class ?!?!?!?
Summary: "new package" action sometimes creates a new Java Class ?!?!?!?
Status: RESOLVED INVALID
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P4 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-11 18:55 UTC by Jan Jancura
Modified: 2007-09-26 09:14 UTC (History)
1 user (show)

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 Jan Jancura 2002-12-11 18:55:42 UTC
1) start a clean projects build 
2) Sources - popup menu - new file / folder
3) create Java Packaga "examples" (yes it already
exists)
=> new "HelloWorld_1.java" file is created
Comment 1 Pavel Buzek 2002-12-12 14:08:25 UTC
This is actually reproducible even in 3.4 :-) JavaPackageIterator first creates the package folder (or 
all the folders that form package name if needed) and then calls createFromTemplate() to select the 
folder in the explorer. createFromTemplate on folder copies its contents ;-)
Comment 2 Pavel Buzek 2002-12-13 22:08:32 UTC
Fixed in the prj40_prototype branch, removing PROJECTS keyword. 

Leaving open for trunk, since this issue is reproducible even there. You can create 
java package for an existing folder and if this folder is not empty its contents gets 
duplicated. Lowering priority to P4.

cvs commit -m "#29480 - do not allow creation of an existing package (to avoid 
duplication of i..." PackagePanel.java (in directory 
C:\nb\new_projects\sources\java\src\org\netbeans\modules\java\ui\wizard\)
Checking in PackagePanel.java;
/cvs/java/src/org/netbeans/modules/java/ui/wizard/Attic/PackagePanel.java,v  <--  
PackagePanel.java
new revision: 1.1.2.2; previous revision: 1.1.2.1
Comment 3 Vitezslav Stejskal 2002-12-22 00:54:29 UTC
So, Pavle, could you merge your fix in main trunk?
Comment 4 Svata Dedic 2003-02-28 14:04:33 UTC
It seems that the N.F.T. Wizard impl already checks for existing files
in dev trunk.