diff options
author | Alexander Kurtakov | 2018-05-08 10:59:48 +0000 |
---|---|---|
committer | Karsten Thoms | 2018-05-09 09:59:36 +0000 |
commit | 1e7a29e071953ebb2101ad3b6c582b560b49845d (patch) | |
tree | d030972df65f98ab09bf7c71f0bd50e001a95314 /org.eclipse.debug.tests | |
parent | 3d920a7a364fdc3fa02da2c12f056ca4375525ce (diff) | |
download | eclipse.platform.debug-1e7a29e071953ebb2101ad3b6c582b560b49845d.tar.gz eclipse.platform.debug-1e7a29e071953ebb2101ad3b6c582b560b49845d.tar.xz eclipse.platform.debug-1e7a29e071953ebb2101ad3b6c582b560b49845d.zip |
Bug 533788 - Use StandardCharsetsI20180509-0800
Another bunch of such changes.
Change-Id: I4012772607b8f7c165156b8d03fbd5bcbee4b581
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'org.eclipse.debug.tests')
-rw-r--r-- | org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchConfigurationTests.java | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchConfigurationTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchConfigurationTests.java index 3e0490a77..947af08a2 100644 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchConfigurationTests.java +++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchConfigurationTests.java @@ -21,8 +21,7 @@ import java.nio.ByteBuffer; import java.nio.charset.Charset; import java.nio.charset.CharsetDecoder; import java.nio.charset.CodingErrorAction; -import java.nio.charset.IllegalCharsetNameException; -import java.nio.charset.UnsupportedCharsetException; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -139,16 +138,7 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau * @throws IOException if a problem occurred reading the stream. */ public static char[] getInputStreamAsCharArray(InputStream stream) throws IOException { - Charset charset = null; - try { - charset = Charset.forName("UTF-8"); //$NON-NLS-1$ - } catch (IllegalCharsetNameException e) { - System.err.println("Illegal charset name : " + "UTF-8"); //$NON-NLS-1$ //$NON-NLS-2$ - return null; - } catch(UnsupportedCharsetException e) { - System.err.println("Unsupported charset : " + "UTF-8"); //$NON-NLS-1$ //$NON-NLS-2$ - return null; - } + Charset charset = StandardCharsets.UTF_8; CharsetDecoder charsetDecoder = charset.newDecoder(); charsetDecoder.onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE); byte[] contents = getInputStreamAsByteArray(stream, -1); |