Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2016-04-16 08:44:13 +0000
committerAlexander Kurtakov2016-04-16 08:44:13 +0000
commit18cb084eeee21bab27389aeefe7e6d1e597721f0 (patch)
tree8ad768c01bcca2676a052b20b4fde0bc55f25b25 /org.eclipse.ui.intro.universal
parent066e19b47467729e85007331942e1dade09a647e (diff)
downloadeclipse.platform.ua-18cb084eeee21bab27389aeefe7e6d1e597721f0.tar.gz
eclipse.platform.ua-18cb084eeee21bab27389aeefe7e6d1e597721f0.tar.xz
eclipse.platform.ua-18cb084eeee21bab27389aeefe7e6d1e597721f0.zip
Bug 491847 - Start using StandardCharsets Y20160421-1000I20160419-0800I20160417-1112
For bundles that are at Java 1.7+ level we can start using StandardCharsets to eliminate the need to handle UnsupportedEncodingExceoption, reduce risk of mistyping encoding, mark the strings as non-nls and etc. Change-Id: I57b45096b934ef4f1a99fad4bb88a8a9ce019005 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'org.eclipse.ui.intro.universal')
-rw-r--r--org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/contentdetect/ContentDetectHelper.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/contentdetect/ContentDetectHelper.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/contentdetect/ContentDetectHelper.java
index 95aee186e..7fb469e04 100644
--- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/contentdetect/ContentDetectHelper.java
+++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/contentdetect/ContentDetectHelper.java
@@ -19,6 +19,7 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL;
+import java.nio.charset.StandardCharsets;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
@@ -107,7 +108,7 @@ public class ContentDetectHelper {
final File stateFile = getStateFile(filename);
FileInputStream input = new FileInputStream(stateFile);
- reader = new InputStreamReader(input, "utf-8"); //$NON-NLS-1$
+ reader = new InputStreamReader(input, StandardCharsets.UTF_8);
memento = XMLMemento.createReadRoot(reader);
@@ -134,7 +135,7 @@ public class ContentDetectHelper {
OutputStreamWriter writer = null;
try {
FileOutputStream stream = new FileOutputStream(stateFile);
- writer = new OutputStreamWriter(stream, "utf-8"); //$NON-NLS-1$
+ writer = new OutputStreamWriter(stream, StandardCharsets.UTF_8);
memento.save(writer);
} catch (IOException e) {
stateFile.delete();

Back to the top