Bug 4580 - StringIndexOutOfBoundsException problem
Summary: StringIndexOutOfBoundsException problem
Status: RESOLVED INVALID
Alias: None
Product: Ant
Classification: Unclassified
Component: Core (show other bugs)
Version: 1.3
Hardware: Sun Solaris
: P3 normal (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-11-01 18:14 UTC by John Nguyen
Modified: 2008-02-22 12:18 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Nguyen 2001-11-01 18:14:15 UTC
The exception below occurs when the PS1 shell prompt is set as follows ...

export PS1='[$USER@$HOSTNAME:$PWD]\
$ENV_TYPE> '

When PS1 is set to something like "$ ", the problem goes away ...


> ./ant unpack
+++++++++++++++++++++++
ANT_HOME= /home1/jnguyen/af/af/site/../tools/ant/
ANT_HOME_SAVE=
+++++++++++++++++++++++

BUILD FAILED

/home1/jnguyen/af/af/site/build.xml:26: /home1/jnguyen/af/af/site/build.xml:26: 
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
--- Nested Exception ---
/home1/jnguyen/af/af/site/build.xml:26: 
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
--- Nested Exception ---
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
        at java.lang.Throwable.fillInStackTrace(Native Method)
        at java.lang.Throwable.fillInStackTrace(Compiled Code)
        at java.lang.Throwable.<init>(Compiled Code)
        at java.lang.Exception.<init>(Exception.java:42)
        at java.lang.RuntimeException.<init>(RuntimeException.java:47)
        at java.lang.IndexOutOfBoundsException.<init>
(IndexOutOfBoundsException.java:44)
        at java.lang.StringIndexOutOfBoundsException.<init>
(StringIndexOutOfBoundsException.java:57)
        at java.lang.String.substring(Compiled Code)
        at org.apache.tools.ant.taskdefs.Property.loadEnvironment(Compiled Code)
        at org.apache.tools.ant.taskdefs.Property.execute(Property.java:172)
        at org.apache.tools.ant.ProjectHelper$TaskHandler.finished
(ProjectHelper.java:482)
        at org.apache.tools.ant.ProjectHelper$AbstractHandler.endElement
(ProjectHelper.java:204)
        at org.xml.sax.helpers.XMLReaderAdapter.endElement
(XMLReaderAdapter.java:347)
        at org.apache.xerces.parsers.SAXParser.endElement(SAXParser.java:1403)
        at org.apache.xerces.validators.common.XMLValidator.callEndElement
(Compiled Code)
        at org.apache.xerces.framework.XMLDocumentScanner.scanElement(Compiled 
Code)
        at 
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch
(Compiled Code)
        at org.apache.xerces.framework.XMLDocumentScanner.parseSome(Compiled 
Code)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1035)
        at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
        at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
        at org.apache.tools.ant.ProjectHelper.parse(Compiled Code)
        at org.apache.tools.ant.ProjectHelper.configureProject
(ProjectHelper.java:85)
        at org.apache.tools.ant.Main.runBuild(Compiled Code)
        at org.apache.tools.ant.Main.main(Main.java:149)

Total time: 5 seconds
Final Exit Code = 1
Comment 1 Conor MacNeill 2001-11-01 18:20:19 UTC
This has been fixed in Ant 1.4.