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 47611 - [40cat] New project from existing code wizard throws exception if project is created twice
Summary: [40cat] New project from existing code wizard throws exception if project is ...
Status: RESOLVED DUPLICATE of bug 42422
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 4.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks: 41537
  Show dependency tree
 
Reported: 2004-08-20 23:36 UTC by pasek
Modified: 2004-08-23 22:09 UTC (History)
2 users (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 pasek 2004-08-20 23:36:45 UTC
[ BUILD # : Beta1 ]
[ JDK VERSION : J2SE 1.5.0 ]

Setup for problem:

Project Dir: D:\Temp\ProjectYZ
Src Dir: D:\Temp\ProjectYZ/src
Test Src Dir: D:\Temp\ProjectYZ/test

If I try to create a project for this setup for a second time (after I deleted all files of the first project creation inside these directories) the following Exception is thrown:

java.lang.IllegalArgumentException: Already a project in MasterFileObject@10ac5e8[file:/D:/Temp/ProjectYZ/]
	at org.netbeans.spi.project.support.ant.ProjectGenerator$1.run(ProjectGenerator.java:81)
	at org.openide.util.Mutex.writeAccess(Mutex.java:298)
	at org.netbeans.spi.project.support.ant.ProjectGenerator.createProject0(ProjectGenerator.java:78)
	at org.netbeans.spi.project.support.ant.ProjectGenerator.createProject(ProjectGenerator.java:73)
	at org.netbeans.modules.java.j2seproject.J2SEProjectGenerator.createProject(J2SEProjectGenerator.java:109)
	at org.netbeans.modules.java.j2seproject.J2SEProjectGenerator.createProject(J2SEProjectGenerator.java:74)
	at org.netbeans.modules.java.j2seproject.ui.wizards.NewJ2SEProjectWizardIterator.instantiate(NewJ2SEProjectWizardIterator.java:104)
	at org.openide.loaders.TemplateWizard$Brigde2Iterator.instantiate(TemplateWizard.java:957)
	at org.openide.loaders.TemplateWizard.handleInstantiate(TemplateWizard.java:549)
	at org.openide.loaders.TemplateWizard.instantiateImpl(TemplateWizard.java:465)
	at org.openide.loaders.TemplateWizard.instantiate(TemplateWizard.java:351)
	at org.netbeans.modules.project.ui.actions.NewProject.actionPerformed(NewProject.java:75)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2167)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
	at java.awt.Component.processMouseEvent(Component.java:5465)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3089)
	at java.awt.Component.processEvent(Component.java:5230)
	at java.awt.Container.processEvent(Container.java:1961)
	at java.awt.Component.dispatchEventImpl(Component.java:3933)
	at java.awt.Container.dispatchEventImpl(Container.java:2019)
	at java.awt.Component.dispatchEvent(Component.java:3781)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4205)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3885)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3815)
	at java.awt.Container.dispatchEventImpl(Container.java:2005)
	at java.awt.Window.dispatchEventImpl(Window.java:1764)
	at java.awt.Component.dispatchEvent(Component.java:3781)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Comment 1 Jesse Glick 2004-08-21 00:54:39 UTC
Tomas can you look at it? I thought this category of problem was long
since fixed, but maybe not...
Comment 2 Jesse Glick 2004-08-21 00:58:14 UTC
Reproducible for me. The question is what to do about it. The project
manager thinks there is still a project there because the project
directory still exists. It does listen for deletions of the project
directory, but not just deletion of project metadata (since only the
project factory knows what the project metadata actually is).

Not solvable for 4.0, I think - would require API changes.

Reporter: either delete entire project directory (if it has nothing
valuable), or restart IDE between attempts.

*** This issue has been marked as a duplicate of 42422 ***
Comment 3 pasek 2004-08-21 09:57:47 UTC
Maybe you should just catch the exception and present a more pleasant
error message.
Comment 4 Jesse Glick 2004-08-21 17:46:14 UTC
Good idea. Even better, I will put in a fix to make the New Project
wizard prevent you from even finishing under this circumstance. It
will display a brief error message advising you to restart the IDE if
you wish to reuse that project folder. (Only applies if the folder is
really clear of metadata from the previous project such as nbproject/
and build.xml; otherwise a different message is shown.)
Comment 5 Jesse Glick 2004-08-23 22:09:14 UTC
Prevent user from completing dialog under such circumstances, with a
message:

committed   * Up-To-Date  1.33       
java/j2seproject/src/org/netbeans/modules/java/j2seproject/ui/wizards/Bundle.properties
committed   * Up-To-Date  1.23       
java/j2seproject/src/org/netbeans/modules/java/j2seproject/ui/wizards/PanelSourceFolders.java