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 43190

Summary: AntReferenceHelper must encode spaces
Product: projects Reporter: David Konecny <dkonecny>
Component: AntAssignee: David Konecny <dkonecny>
Status: CLOSED FIXED    
Severity: blocker CC: asotona
Priority: P3 Keywords: SPACE_IN_PATH
Version: 4.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description David Konecny 2004-05-13 09:30:54 UTC
1. wrong property name is created when referenced
project contains spaces in name

(see also issue 42903)
Comment 1 David Konecny 2004-05-17 12:50:38 UTC
Adam, I realized that this is your bug. The reference ID uses
ProjectInformation.getName() and Javadoc of this method says that
returned name is programmatic name for usage in Ant scripts. It is job
of your project type to return something without spaces.

Check also issue 42732 in which I implemented two methods which you
could use for this.
Comment 2 David Konecny 2004-05-17 14:07:10 UTC
Adam, see also issue 43364.
Comment 3 Jesse Glick 2004-05-17 16:53:54 UTC
I hope ReferenceHelper does appropriate sanity checking of incoming
reference IDs, e.g. from ProjectInformation.getName(), and reacts
appropriately? Should IMHO either create a proper name quietly or log
a proper message. Prefer the former, since ReferenceHelper is
responsible for making its own suitable IDs for subprojects - PI.name
should be used as a hint, but it may be uniquified anyway.
Comment 4 David Konecny 2004-05-17 17:02:28 UTC
RH can do sanity check of incoming IDs, but is not that useless code
duplicity? The PI.getName is API and says that it must be ID. What you
are suggesting means that nobody should rely on it and create their
own IDs. Then what's the value of PI.getName. I could use directly
displayName and encode an ID from it.

It is trivial change (and I already had that done) to call
PU.getUsablePropertyName, but it seemed to me redundant.
Comment 5 Jesse Glick 2004-05-17 17:05:51 UTC
Feel free to log an error message if the PI.name is inappropriate, but
RH should still be more robust against API usage errors.
Comment 6 David Konecny 2004-05-17 17:53:40 UTC
Fixed in:
src/org/netbeans/spi/project/support/ant/ReferenceHelper.java
new revision: 1.10; previous revision: 1.9
Comment 7 Jaromir Uhrik 2005-07-14 16:18:36 UTC
Verified.