Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 14731 - NbClassPath.getClassPath() should not add quotes
NbClassPath.getClassPath() should not add quotes
Product: platform
Classification: Unclassified
Component: -- Other --
PC All
: P3 (vote)
: 3.x
Assigned To: Svata Dedic
Depends on:
Blocks: 17148
  Show dependency treegraph
Reported: 2001-08-23 13:30 UTC by _ mruflin
Modified: 2008-12-22 22:41 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description _ mruflin 2001-08-23 13:30:04 UTC
NClassPath.getClassPath() adds quotes at the beginning and the end whenever the 
CP contains white spaces. Adding quotes should be handled by the user of 
NbClassPath and not by NbCP itself.
Comment 1 Svata Dedic 2001-08-23 13:36:51 UTC
Hmm, I don't think so - but anyway, the result of
NbClassPath.getClassPath() is used at various places in the IDE, which
assumes there are quotes.
If you decide to accept/fix this issue, please attach a patch at first
and notify people on nbdev@ that and how they should adapt their code.
Comment 2 _ mruflin 2001-08-23 13:55:46 UTC
Maybe I was unclear: It does not *always* add quotes, only when the 
CP contains white spaces. This is inconsistent (and should be 
documented at least). Below Jesse's answer to this issue


Yes, I agree it is incorrect for NbClassPath to add its own quoting, 
that is not its responsibility. I would file a bug against 
NbClassPath. There are a lot of messy quoting things implemented in 
NbProcessDescriptor especially which I've never really understood; 
part of the problem is the inconsistencies between Windows and Unix 
quoting rules. NbProcessDescriptor is *supposed* to behave as if the 
Unix Bourne shell were being used, and accommodate platform 
differences accordingly; but I doubt this really works as described.


I know that such changes affect a lot of other code. Maybe we should 
at least consider to clean up such things for the 4.0 version.
Comment 3 Jan Zajicek 2001-09-10 11:30:03 UTC
Assigning. So if this will be changed into 4.0, don't forget to change
the target milestone.
Comment 4 anovak 2001-09-11 11:04:22 UTC
Not doable for 3.3. I am afraid that it would touch too many dark
sides of our code... Maybe not doable at all.
Comment 5 anovak 2001-09-20 14:34:19 UTC
Comment 6 anovak 2001-09-20 14:36:40 UTC
later again
Comment 7 anovak 2001-09-20 14:41:37 UTC
Comment 8 anovak 2001-09-20 14:42:35 UTC
Comment 9 Jesse Glick 2001-11-15 22:15:08 UTC
This was the cause of issue #17148.
Comment 10 Svata Dedic 2002-07-08 11:40:00 UTC
This issue will not be fixed for NetBeans 3.*. Hopefully the
NbClassPath will be superseded by ClassPath API in NetBeans 4.0, so
usage of NbClassPath will be most probably deprecated (as it queries
filesystems) in favour of the new APIs.

The issue is almost uncorrectable in the IDE's current implementation,
since clients of NbClassPath rely on that it quotes the string if
necessary, if clients of NbProcessDescriptor were the only ones,
proper quoting could be done in NBPD, but the result string is used in
more places. It could be possible to add quotes always to the result
string, but it does not seem necessary: clients which manipulate w/
the result are already aware of that the string may be quoted.
Comment 11 Jesse Glick 2002-07-08 12:43:22 UTC
Can we at least add to the Javadoc a *warning* about what it is going
to do? "clients which manipulate w/ the result are already aware of
that the string may be quoted" - not true of random people innocently
using the API, since code tested on normal examples (no spaces in path
etc.) will seem to work fine, but could break suddenly with strange
Comment 12 Svata Dedic 2002-07-08 12:55:29 UTC
Will do. I will mention as well that the NbClassPath functionality may
be deprecated in the next version of NetBeans, OK ?
Comment 13 Svata Dedic 2002-07-29 07:31:05 UTC
Comment about quoting added. Again closing as wontfix, will be
superseded by new APIs (ClassPath API ?)
Comment 14 Marian Mirilovic 2003-07-25 18:16:49 UTC
Without new informations for long time - verifying.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo