# HG changeset patch # User bpb # Date 1394226307 28800 # Node ID 8b590110ed8e4b61861e641511426119d5d950f5 # Parent b0af2c7c8c91d12fe04e3675f9b3219cb866aea4 8036848: Fix deprecation warning in sun.misc.CharacterDecoder Summary: Replace use of deprecated method with its recommended successor. Reviewed-by: mchung diff -r b0af2c7c8c91 -r 8b590110ed8e jdk/src/share/classes/sun/misc/CharacterDecoder.java --- a/jdk/src/share/classes/sun/misc/CharacterDecoder.java Fri Mar 07 13:00:25 2014 -0800 +++ b/jdk/src/share/classes/sun/misc/CharacterDecoder.java Fri Mar 07 13:05:07 2014 -0800 @@ -183,25 +183,21 @@ * buffer and returns a byte array containing the data. * @exception CEFormatException An error has occurred while decoding */ - public byte decodeBuffer(String inputString)[] throws IOException { - byte inputBuffer[] = new byte[inputString.length()]; - ByteArrayInputStream inStream; - ByteArrayOutputStream outStream; - - inputString.getBytes(0, inputString.length(), inputBuffer, 0); - inStream = new ByteArrayInputStream(inputBuffer); - outStream = new ByteArrayOutputStream(); + public byte[] decodeBuffer(String inputString) throws IOException { + byte inputBuffer[] = inputString.getBytes(); + ByteArrayInputStream inStream = new ByteArrayInputStream(inputBuffer); + ByteArrayOutputStream outStream = new ByteArrayOutputStream(); decodeBuffer(inStream, outStream); - return (outStream.toByteArray()); + return outStream.toByteArray(); } /** * Decode the contents of the inputstream into a buffer. */ - public byte decodeBuffer(InputStream in)[] throws IOException { + public byte[] decodeBuffer(InputStream in) throws IOException { ByteArrayOutputStream outStream = new ByteArrayOutputStream(); decodeBuffer(in, outStream); - return (outStream.toByteArray()); + return outStream.toByteArray(); } /**