ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 975] New - Problem of loading environment variables
Date Wed, 14 Mar 2001 19:27:30 GMT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=975

*** shadow/975	Wed Mar 14 11:27:30 2001
--- shadow/975.tmp.13557	Wed Mar 14 11:27:30 2001
***************
*** 0 ****
--- 1,66 ----
+ +============================================================================+
+ | Problem of loading environment variables                                   |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 975                         Product: Ant                     |
+ |       Status: NEW                         Version: 1.3                     |
+ |   Resolution:                            Platform: PC                      |
+ |     Severity: Normal                   OS/Version:                         |
+ |     Priority: Medium                    Component: Core tasks              |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: ant-dev@jakarta.apache.org                                   |
+ |  Reported By: jiri_luzny@yahoo.com                                         |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ I'm trying to extend our ANT build stuff(that currently works fine on Linux) to 
+ Windows2000+cygwin environment. I have figured out that there is a problem in 
+ the build process when it tries to read an environment variable that doesn't 
+ follow the "name=value" pattern(the variable doesn't contain name). It causes 
+ the following exception:
+ 
+ java.lang.StringIndexOutOfBoundsException: String index out of range: -1
+         at java.lang.String.substring(String.java:1503)
+         at org.apache.tools.ant.taskdefs.Property.loadEnvironment
+ (Property.java:248)
+         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.apache.xerces.parsers.SAXParser.endElement(SAXParser.java:1377)
+         at org.apache.xerces.validators.common.XMLValidator.callEndElement
+ (XMLValidator.java:837)
+         at org.apache.xerces.framework.XMLDocumentScanner.scanElement
+ (XMLDocumentScanner.java:1855)
+         at 
+ org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch
+ (XMLDocumentScanner.java:1233)
+         at org.apache.xerces.framework.XMLDocumentScanner.parseSome
+ (XMLDocumentScanner.java:380)
+         at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:861)
+         at javax.xml.parsers.SAXParser.parse(SAXParser.java:211)
+         at org.apache.tools.ant.ProjectHelper.parse(ProjectHelper.java:117)
+         at org.apache.tools.ant.ProjectHelper.configureProject
+ (ProjectHelper.java:85)
+         at org.apache.tools.ant.Main.runBuild(Main.java:403)
+         at org.apache.tools.ant.Main.main(Main.java:149)
+ 
+ 
+ Here there is the fragment of the code that should be fixed + the fix (the line 
+ with comment):
+ 
+ org.apache.tools.ant.taskdefs.Property:
+ protected void loadEnvironment( String prefix ) {
+         .
+         .
+         .
+                 int pos = entry.indexOf('=');   
+         +        if (pos > 0) {  //CHECK IF '=' HAS BEEN FOUND
+                   props.put(prefix + entry.substring(0, pos),
+                           entry.substring(pos + 1));
+         +        }
+         .
+         .
+         .

---------------------------------------------------------------------
To unsubscribe, e-mail: ant-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: ant-dev-help@jakarta.apache.org


Mime
View raw message