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.
Summary: | Cannot use existing directory when creating new project from existing sources | ||
---|---|---|---|
Product: | projects | Reporter: | _ tboudreau <tboudreau> |
Component: | Ant | Assignee: | Tomas Zezula <tzezula> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | jchalupa, jglick, rmatous |
Priority: | P2 | ||
Version: | 4.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | 42421 | ||
Bug Blocks: | 42682 | ||
Attachments: |
exc stack trace
Exception stack trace exc stack trace |
Description
_ tboudreau
2004-05-21 13:04:52 UTC
I believe this is a dupe of an already filed robustness bug. BTW the reporter incorrectly said that he was trying to make a freeform project. This is a regular j2seproject from existing sources. I got exactly the same exception when doing similar thing. I closed project becasue it had wrong metadata, then I deleted that project from disk and then I wanted to create new project with the same name -> exc. Raising prio to P3. The New Project Wizard correctly allows user to create new Project since the old project dir is deleted but the ProjectManager.getDefault().findProject(directory) returned project for the deleted directory. ProjectGenerator can not heal from this and throws Exception. The actual problem is in the rm -rf (external command does not refresh filesystems). Agreed that that is likely the problem. Lowering priority since it was a user error not to refresh files after making external changes with the IDE open. However the j2seproject wizard could attempt to refresh the filesystem associated with the target directory. If the refresh shows the dir as being removed, that should cause FileUtil.toFileObject to create a fresh FileObject for the dir when it is created, meaning ProjectManager will not report a problem (since the cache key is FileObject). Will it work? Sounds good to me. Currently the FileSystem where the project folder is created is refreshed (J2SEProjectGenerator.createProjectDir(File). I can't reproduce it anymore. Just reproduced on custom build 20040607, JDK 1.5.0 b51a. I closed particular project then I renamed it on disk outside of IDE and then I wanted to create new project with the same name. Created attachment 15525 [details]
exc stack trace
No plans to support that in D I think, sorry. Requires additions to project API and various kinds of infrastructure to support it. Restart the IDE. OK. I will at least try to forbid the user to enter such a directory and not to throw the exception. This may be enough as a fix of this issue. Hmm, I think this is a problem. I ran into this myself and heard from 3 other people that it happened to them too. The biggest problem I see that a *closed* project is cached by the IDE and starts throwing errors after external changes like rename, move, delete. This is very confusing for the user, because she believes the project is really closed and making external modifications should be perfectly fine. IMO, this is a P2 bug. I've tried to delete externally the closed project and to create new one on the same place with the same name and no exception is thrown. I also tried to move closed project and reopen it also no exception. Could you add more details what you mean by edit or move and attach the stack trace of exceptions? Sure. See the attached exceptions. All I did was: 1. Open an existing project. 2. Close it. 3. Delete the project folder externally. 4. Go back to the IDE. Exception is thrown. Created attachment 15894 [details]
Exception stack trace
The attached exception was already fixed this morning in the java/j2seplatform/src/org/netbeans/modules/java/j2seplatform/platformdefinition/DefaultClassPathProvider.java revision 1.3 Doesn't seem to be fixed. I've reproduced Tim's exc again in custom build 20040727 on JDK 1.5.0 b58. My Steps: I had opened freeform project that I closed. Then I deleted that project on filesystem outside of IDE and wanted to create the project with the same name again - I got the exception. Created attachment 16482 [details]
exc stack trace
Note that the current description is using a freeform project, not a j2seproject. Might be a masterfs problem. If you delete a project dir on disk and switch to the IDE (give it focus), that should cause a refresh, which should invalidate the old project dir FileObject. While the ProjectManager may continue to have it in cache, any subsequent wizard should not get the same FileObject back, since it represented a deleted directory, even if a dir of the same name is created again. (Radek, is that correct?) Added refresh before project dir is created to notify FS about change. It is safer than depending on window focus. Checking in ant/freeform/src/org/netbeans/modules/ant/freeform/FreeformProjectGenerator.java; /cvs/ant/freeform/src/org/netbeans/modules/ant/freeform/FreeformProjectGenerator.java,v <-- FreeformProjectGenerator.java new revision: 1.18; previous revision: 1.17 done Processing log script arguments... More commits to come... Checking in java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEProjectGenerator.java; /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEProjectGenerator.java,v <-- J2SEProjectGenerator.java new revision: 1.20; previous revision: 1.19 done Note: I also modified ProjectManager to remove any cache entries for folders that are deleted (acc. to fileFolderDeleted). As I mentioned in the last comment, it shouldn't matter, but maybe that will make things a bit safer. |