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 51657 - Environment variables with separators cause IOExceptions
Summary: Environment variables with separators cause IOExceptions
Status: CLOSED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 4.x
Hardware: Sun All
: P4 blocker (vote)
Assignee: Petr Nejedly
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-18 18:28 UTC by foliver
Modified: 2008-12-22 22:40 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Exception stack dumped by netbeans at IOException (594 bytes, text/plain)
2004-11-18 18:30 UTC, foliver
Details

Note You need to log in before you can comment on or make changes to this bug.
Description foliver 2004-11-18 18:28:30 UTC
Environment variables may contain separators, e.g.
with csh:

set list=( a \
           b \
           c )
setenv LIST "$list"

When netbeans encounters this in the environment,
it throws an IOException.
Comment 1 foliver 2004-11-18 18:30:50 UTC
Created attachment 18963 [details]
Exception stack dumped by netbeans at IOException
Comment 2 pfelenda 2004-11-24 13:18:30 UTC
The expeiton come from java.io package. This is maybe problem of JDK.
It is only netbeans problem ? Tries do to set the variable in other java 
application ?
Comment 3 foliver 2004-11-29 23:21:15 UTC
As indicated by the stack listing, the exception is thrown 
explicitly by netbeans at 

  org.netbeans.core.NbTopManager.readEnvMap(NbTopManager.java:573)

This method contains something like:

    if (cc == sep) {
        throw new IOException(
                     "Environment variable name starting with '"
                    + key + "' contained the separator (char)" + 
                    (int)sep);
    }

In /bin/csh, doing this before starting netbeans will cause the 
problem:

setenv LIST " a \
              b \
              c"
Comment 4 Milan Kubec 2004-12-13 12:59:16 UTC
Is it allowed to have separators in env variables?
Comment 5 Milan Kubec 2005-01-21 10:18:27 UTC
Reassigning for evaluation.
Comment 6 Marian Mirilovic 2005-02-17 07:24:43 UTC
Petr, please look at this, thanks.
Comment 7 Petr Nejedly 2005-02-18 11:12:11 UTC
> Is it allowed to have separators in env variables?

Generally, yes. Strange it doesn't fail on IFS.
Anyway, upgrading to JDK1.5 will fix your problem as it has the API
for enviroment access.
I'm closing this as WONTFIX as it is generally impossible to parse the
enviroment with separators properly (imagine a\nb=bb\nc) and there is
a superior solution already.
Comment 8 Tomas Danek 2005-08-01 14:01:45 UTC
closing.