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 41277

Summary: New wizard says file already exists even if it's not true
Product: platform Reporter: sermetyucel <sermetyucel>
Component: Dialogs&WizardsAssignee: Jiri Rechtacek <jrechtacek>
Status: VERIFIED FIXED    
Severity: blocker CC: jchalupa, mmirilovic, tpavek, ttran
Priority: P1 Keywords: REGRESSION, SIMPLEFIX
Version: 3.x   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Attachments: patch applied in maintrunk

Description sermetyucel 2004-03-24 15:47:12 UTC
I tried to add a Bundle.properties. I select the 
directory under the project tab. I select the 
properties template. Type the name Bundle. 
Finish button is disabled. The red message says 
that file already exists. I check the directory, 
no such file exist. I try, BundleX. It takes it. 
I check the directory to make sure files is 
under the correct directory. I delete the file 
using the Netbeans delete. File is gone. Try 
again. Same issue.

I change the file name to BundleX. Then I rename 
the file using Netbeans it takes it.

There may have been a Bundle file there sometime 
ago. But definetely not now. I do not know what 
makes it think that file exists. Maybe the 
somewhere under user directory?
Comment 1 Ann Sunhachawee 2004-03-25 19:13:04 UTC
See also a separate thread on NBusers on the same issue. I can also
reproduce this.
http://www.netbeans.org/servlets/ReadMsg?msgId=721074&listName=nbusers

Raised priority to P2, since this will be highly visible and should be
fixed for the release.
Comment 2 Tomas Pavek 2004-03-26 06:39:55 UTC
Reassigning to openide.

As already mentioned on nbusers:

  For example I have a build script "src/testsuite/build.xml". When
  I try to create an other build script "src/build.xml" NB says
  "The file build.xml already exists."
  This problem occurs with any file type, folders and packages.
  However, I can first create a file (e.g. build1.xml) and then
  rename it.
Comment 3 David Konecny 2004-03-26 07:58:45 UTC
Template Wizard issue.
Comment 4 Jiri Rechtacek 2004-03-26 11:17:56 UTC
It's regression of issue 33612, a workaround committed in 04/02/03.
Problem: FileObject.getChildren() is called with true (e.g. recursive
to subfolders) instead of false (e.g. only direct level).
Comment 5 Jiri Rechtacek 2004-03-26 11:19:19 UTC
Created attachment 14170 [details]
patch applied in maintrunk
Comment 6 Jiri Rechtacek 2004-03-26 11:33:39 UTC
Diagnosis: This defect appears in only on Windows. If any folder has a
subfolder with an object, say MyMain.java.
E.g. I have <mounted root>/myClasses/test/MyMain.java. If I want to
add new object (by TemplateWizard) to folder myClasses with same name
MyMain.java, then TemplateWizard scans *all* subfolders for this file
and succeeds. It's the problem. The fix restricts scanning only on
first level, e.g. only direct children of myClasses folder.
Comment 7 rmatous 2004-03-26 15:31:28 UTC
Right and safe fix.
Comment 8 David Konecny 2004-03-28 16:58:27 UTC
Looks OK and safe.
Comment 9 Jiri Rechtacek 2004-03-29 08:36:09 UTC
Fix backported to release36 branch.
Comment 10 Lukas Hasik 2004-04-02 16:05:50 UTC
verified in nb36 RC2. It works as it should now.