This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
[patch #2] String.getBytes()
- To: java-discuss@sourceware.cygnus.com
- Subject: [patch #2] String.getBytes()
- From: Bryce McKinlay <bryce@albatross.co.nz>
- Date: Wed, 21 Apr 1999 21:19:15 +1200
According to the JDK 1.2 docs, getBytes() isn't supposed to throw an
UnsupportedEncodingException. I have confirmed this with JDK 1.2/javac
regards
[ bryce ]
RCS file: /cvs/java/libgcj/libjava/java/lang/String.java,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 String.java
--- String.java 1999/04/07 14:52:38 1.1.1.1
+++ String.java 1999/04/21 09:12:58
@@ -132,9 +132,16 @@
public native void getChars (int srcBegin, int srcEnd,
char[] dst, int dstBegin);
- public byte[] getBytes () throws UnsupportedEncodingException
+ public byte[] getBytes ()
{
- return getBytes (System.getProperty("file.encoding", "8859_1"));
+ try
+ {
+ return getBytes (System.getProperty("file.encoding",
"8859_1"));
+ }
+ catch (UnsupportedEncodingException x)
+ {
+ // shouldn't happen
+ }
}