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 60074 - folderCreated fired from FileObject.getFileObject for a folder which already exists (and was created by FileObject.createFolder)
Summary: folderCreated fired from FileObject.getFileObject for a folder which already ...
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: rmatous
URL:
Keywords:
Depends on:
Blocks: 60011
  Show dependency tree
 
Reported: 2005-06-15 15:30 UTC by Jesse Glick
Modified: 2008-12-22 19:56 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 Jesse Glick 2005-06-15 15:30:22 UTC
See issue #60011 for background.
NbModuleProjectGenerator.createSuiteComponentModule (apisupport/project) has
presumably already run. Among other things, this creates $projdir/test/unit/src
(createEmptyTestDir) using the Filesystems API. Later,
ProjectManager.findProject is called on $projdir, and as the project's
constructor is running, it calls $projdir.getFileObject("test/unit/src"). Some
refreshing code in masterfs starts to run (which is I guess normal?) but
fireFileFolderCreatedEvent is actually called (and begins notifying listeners).
This is surely wrong: the file was created before, using the Filesystems API
(not java.io.File), and any folder creation event should have been fired and
completed then.
Comment 1 rmatous 2005-06-22 13:30:30 UTC
Multi-component pathname separated by File.separatorChar isn't allowed to be
used as a parameter for FileObject.createFolder. 

Thus NbModuleProjectGenerator.createEmptyTestDir is bugy in line
projectDir.createFolder("test/unit/src"); 

Use rather FileUtil.createFolder.

On the other hand MasterFileObject.createFolder should behave in more
predictable way.

Comment 2 Jesse Glick 2005-06-22 20:24:04 UTC
So it should throw an IAE or IOException or something.

I will fix NbModuleProjectGenerator.createEmptyTestDir.
Comment 3 Jesse Glick 2005-06-22 23:23:40 UTC
committed   * Up-To-Date  1.25       
apisupport/project/src/org/netbeans/modules/apisupport/project/NbModuleProjectGenerator.java

Also Javadoc:

committed   * Up-To-Date  1.3        
openide/fs/src/org/openide/filesystems/FileObject.java
Comment 4 rmatous 2005-09-13 12:56:21 UTC
#61578:
/cvs/openide/masterfs/src/org/netbeans/modules/masterfs/MasterFileObject.java,v
 new revision: 1.45; previous revision: 1.44