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: | AntReferenceHelper must encode spaces | ||
---|---|---|---|
Product: | projects | Reporter: | David Konecny <dkonecny> |
Component: | Ant | Assignee: | 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
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. Adam, see also issue 43364. 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. 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. Feel free to log an error message if the PI.name is inappropriate, but RH should still be more robust against API usage errors. Fixed in: src/org/netbeans/spi/project/support/ant/ReferenceHelper.java new revision: 1.10; previous revision: 1.9 Verified. |