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 48398 - When mounting existing source, adding characters to the end of an existing folder isn't recognized as new.
Summary: When mounting existing source, adding characters to the end of an existing fo...
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Tomas Zezula
Depends on:
Blocks: 41537
  Show dependency tree
Reported: 2004-09-02 16:44 UTC by dmartin01
Modified: 2012-05-06 23:58 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description dmartin01 2004-09-02 16:44:13 UTC
If you choose to create a new project as "Java 
Project with Existing Source", you can't use a 
project name that starts with the same 
characters as an existing folder.  

Replication:  You have a project called Netbeans 
located at "C:\Projects\Netbeans\".  Choose to 
create a new project and choose "Java Project 
with Existing Source".  Then for the Project 
Folder, you type "C:\Projects\Netbeans2", it 
will give you the error "Project Folder has to 
be located outside of the folder containing 

What really happens is that the error condition 
is fired as you are typing when you get 
to "C:\Projects\Netbeans".  When you add the "2" 
on the end, the error condition doesn't get 
reset, even though you are no longer re-using 
the source folder as the project folder.
Comment 1 Jesse Glick 2004-09-02 19:09:39 UTC
I just tried in a dev build and it seems to work OK for me. Can you
give more precise instructions?

Anyway, I get a different error than "Project Folder has to be located
outside of the folder containing packages."; I get "Cannot place the
project in a Project Folder that already contains NetBeans project".,
which is the correct message. (Excuse the poor English grammar, hasn't
been reviewed by native speakers yet I think.)

If you were using the beta, try also with a nightly build; might have
been something already fixed in CVS.
Comment 2 dmartin01 2004-09-02 19:17:46 UTC
In your case, the folder you are pointing at already has a Netbeans 
4.0 project in it.  My folder doesn't.  It just contains the 
source.  In my example, I shouldn't be mounting the source folder as 
a project folder, so Netbeans is correct to complain.  But when I 
take corrective action by adding a character on the end to point at 
a completely new folder, Netbeans doesn't realize it like it should.

To recreate, place some source (not a NB project) in a folder, such 
as "C:\Projects\Jesse".  Then try to create a new project 
using "Java Project with Existing Source".  Point at this folder for 
the source, then try to use "C:\Projects\Jesse2".  When you get to 
Jesse, the error fires, but when you type the 2 it won't correct 
Comment 3 dmartin01 2004-09-02 19:22:00 UTC
I'm sorry, I should have said -
use C:\Projects\Jesse2 as the "Project Folder".
Comment 4 Jesse Glick 2004-09-02 19:40:02 UTC
Got it. Yes, is wrong. In several places it
uses constructions such as

ploc.equals(tloc) || ploc.startsWith(tloc)

which is clearly wrong; should be

ploc.equals(tloc) || ploc.startsWith(tloc + File.separatorChar)
Comment 5 Tomas Zezula 2004-09-05 10:26:37 UTC
Checking in
new revision: 1.26; previous revision: 1.25
Comment 6 FreemonSandlewould 2012-05-06 23:58:15 UTC
It is 2012 and I am STILL seeing this error.  Just had to add an x to the beginning of folder name to get it to stop the error!