From: pcm <pcm...@us...> - 2005-08-25 16:55:45
|
Update of /cvsroot/javapathfinder/javapathfinder/src/gov/nasa/jpf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32143/src/gov/nasa/jpf Modified Files: Config.java Log Message: trim property value strings. At least Java 1.4.2 on OS X didn't do this, resulting in NumberFormatExceptions that caused default values to be used when '-show' pretended to have the right property values (hard to see a blank at the end of the line) Index: Config.java =================================================================== RCS file: /cvsroot/javapathfinder/javapathfinder/src/gov/nasa/jpf/Config.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Config.java 8 Jun 2005 23:47:02 -0000 1.5 +++ Config.java 25 Aug 2005 16:55:37 -0000 1.6 @@ -338,6 +338,14 @@ for (Enumeration keys = keys(); keys.hasMoreElements();) { String k = (String) keys.nextElement(); String v = getProperty(k); + + // trim heading and trailing blanks (at least Java 1.4.2 does not take care of trailing blanks) + String v0 = v; + v = v.trim(); + if (v != v0) { + put(k, v); + } + if ("true".equalsIgnoreCase(v) || "t".equalsIgnoreCase(v) || "yes".equalsIgnoreCase(v) || "y".equalsIgnoreCase(v)) { put(k, "true"); |