Commit f50aa505 by Bryce McKinlay Committed by Bryce McKinlay

re PR libgcj/16134 (Memory leak in String.getBytes())

	PR libgcj/16134:
	* gnu/gcj/convert/BytesToUnicode.java: Canonicalize encoding name
	before cache lookup. Thanks to Hannes Wallnoefer.
	* gnu/gcj/convert/UnicodeToBytes.java: Likewise.

From-SVN: r83501
parent 3b56276e
2004-06-22 Bryce McKinlay <mckinlay@redhat.com>
PR libgcj/16134:
* gnu/gcj/convert/BytesToUnicode.java: Canonicalize encoding name
before cache lookup. Thanks to Hannes Wallnoefer.
* gnu/gcj/convert/UnicodeToBytes.java: Likewise.
2004-06-21 Andrew Haley <aph@redhat.com> 2004-06-21 Andrew Haley <aph@redhat.com>
* java/io/ObjectOutputStream.java: Add DEBUG statements * java/io/ObjectOutputStream.java: Add DEBUG statements
......
...@@ -75,6 +75,7 @@ public abstract class BytesToUnicode extends IOConverter ...@@ -75,6 +75,7 @@ public abstract class BytesToUnicode extends IOConverter
{ {
/* First hunt in our cache to see if we have a decoder that is /* First hunt in our cache to see if we have a decoder that is
already allocated. */ already allocated. */
encoding = canonicalize(encoding);
synchronized (BytesToUnicode.class) synchronized (BytesToUnicode.class)
{ {
int i; int i;
...@@ -91,7 +92,7 @@ public abstract class BytesToUnicode extends IOConverter ...@@ -91,7 +92,7 @@ public abstract class BytesToUnicode extends IOConverter
} }
// It's not in the cache, so now we have to do real work. // It's not in the cache, so now we have to do real work.
String className = "gnu.gcj.convert.Input_" + canonicalize (encoding); String className = "gnu.gcj.convert.Input_" + encoding;
Class decodingClass; Class decodingClass;
try try
{ {
......
...@@ -73,6 +73,7 @@ public abstract class UnicodeToBytes extends IOConverter ...@@ -73,6 +73,7 @@ public abstract class UnicodeToBytes extends IOConverter
{ {
/* First hunt in our cache to see if we have a encoder that is /* First hunt in our cache to see if we have a encoder that is
already allocated. */ already allocated. */
encoding = canonicalize(encoding);
synchronized (UnicodeToBytes.class) synchronized (UnicodeToBytes.class)
{ {
int i; int i;
...@@ -88,7 +89,7 @@ public abstract class UnicodeToBytes extends IOConverter ...@@ -88,7 +89,7 @@ public abstract class UnicodeToBytes extends IOConverter
} }
} }
String className = "gnu.gcj.convert.Output_" + canonicalize (encoding); String className = "gnu.gcj.convert.Output_" + encoding;
Class encodingClass; Class encodingClass;
try try
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment