W3C home > Mailing lists > Public > www-jigsaw@w3.org > November to December 1996

Bug in ParseState.java?

From: Anselm Baird_Smith <abaird@www43.inria.fr>
Date: Fri, 27 Dec 1996 09:54:21 +0100 (MET)
Message-Id: <199612270854.JAA24202@www43.inria.fr>
To: Bill Wendling <wendling@ncsa.uiuc.edu>
Cc: www-jigsaw@www10.w3.org
Bill Wendling writes:
 > Hi,
 > 
 > I was looking through ParseState.java and found this method in it.  I
 > don't know if you have addressed it already, but...:

Thanks, it wasn't fixed yet. Here is what I now have:

---
package w3c.www.http;
class ParseState {

    final String toString(byte raw[], boolean lower) {
	if ( lower ) {
	    // To lower case:
	    for (int i = start; i < end ; i++)
		raw[i] = (((raw[i] >= 'A') && (raw[i] <= 'Z'))
			  ? (byte) (raw[i] - 'A' + 'a')
			  : raw[i]);
	} else {
	    // To upper case:
	    for (int i = start; i < end ; i++)
		raw[i] = (((raw[i] >= 'a') && (raw[i] <= 'z'))
			  ? (byte) (raw[i] - 'a' + 'A')
			  : raw[i]);
	}
	return new String(raw, 0, start, end-start);
    }

}
---

Anselm.
Received on Friday, 27 December 1996 03:54:25 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:25 GMT