remm 2004/12/15 03:49:20
Modified: util/java/org/apache/tomcat/util/buf ByteChunk.java
Log:
- If the encoding is invalid, this will cause a weird NPE. This avoids it.
- The usage of a bad encoding should have been logged elsewhere in all cases,
so I don't see the point of logging again.
Revision Changes Path
1.24 +4 -4
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/buf/ByteChunk.java
Index: ByteChunk.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/buf/ByteChunk.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- ByteChunk.java 12 Nov 2004 10:51:49 -0000 1.23
+++ ByteChunk.java 15 Dec 2004 11:49:20 -0000 1.24
@@ -478,11 +478,11 @@
// Method is commented out, in:
return B2CConverter.decodeString( enc );
*/
- } catch (java.io.IOException e) {
- // FIXME
+ } catch (java.io.UnsupportedEncodingException e) {
+ // Use the platform encoding in that case; the usage of a bad
+ // encoding will have been logged elsewhere already
+ strValue = new String(buff, start, end-start);
}
- //System.out.println("BC toString: " + strValue);
- //Thread.dumpStack();
return strValue;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]