Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2020-09-30 05:15:16 +0000
committerAlexander Kurtakov2020-09-30 05:15:16 +0000
commita8d04604b949e0a250a90f41f578c9d8fd8de186 (patch)
tree12711014e28b05107ca2735c1b7c90c6b5c5dce3
parentbf199e4a6c4fff67d8c24dfeced3ad0ade0be84d (diff)
downloadeclipse.platform.debug-a8d04604b949e0a250a90f41f578c9d8fd8de186.tar.gz
eclipse.platform.debug-a8d04604b949e0a250a90f41f578c9d8fd8de186.tar.xz
eclipse.platform.debug-a8d04604b949e0a250a90f41f578c9d8fd8de186.zip
Use StandardCharsets.
UTF8 is always there in any JVM so no need to have code possibly throwing UnsupportedEncodingException due to a typo. Change-Id: Ib422cd94910f58d18b2ba728fe2f394c1f4f52b4 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
index ad5ac4245..caf10c2d7 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -31,6 +31,7 @@ import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
@@ -527,13 +528,14 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
/**
- * Serializes a XML document into a string - encoded in UTF8 format,
- * with platform line separators.
+ * Serializes a XML document into a string - encoded in UTF8 format, with
+ * platform line separators.
*
* @param doc document to serialize
* @return the document as a string
- * @throws TransformerException if an unrecoverable error occurs during the serialization
- * @throws IOException if the encoding attempted to be used is not supported
+ * @throws TransformerException if an unrecoverable error occurs during the
+ * serialization
+ * @throws IOException if I/O error occurs
*/
public static String serializeDocument(Document doc) throws TransformerException, IOException {
ByteArrayOutputStream s = new ByteArrayOutputStream();
@@ -544,7 +546,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
DOMSource source = new DOMSource(doc);
StreamResult outputTarget = new StreamResult(s);
transformer.transform(source, outputTarget);
- return s.toString("UTF8"); //$NON-NLS-1$
+ return s.toString(StandardCharsets.UTF_8);
}
/**

Back to the top