Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.help.base/src/org/eclipse/help/internal/browser/BrowserLog.java15
-rw-r--r--org.eclipse.help.base/src/org/eclipse/help/internal/search/InfoCenter.java3
-rw-r--r--org.eclipse.help.base/src/org/eclipse/help/internal/workingset/WorkingSetManager.java3
-rw-r--r--org.eclipse.help.base/src/org/eclipse/help/search/HelpIndexBuilder.java3
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/StatusProducer.java11
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/AboutService.java3
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/AdvancedSearchService.java3
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/ContentService.java3
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/ContextService.java3
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/ExtensionService.java3
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/IndexFragmentService.java3
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/IndexService.java3
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/NavService.java5
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/SearchService.java5
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/TocFragmentService.java3
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/TocService.java3
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/BreadcrumbsFilter.java5
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/DynamicXHTMLFilter.java4
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/FramesetFilter.java8
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/HighlightFilter.java7
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/InjectionFilter.java11
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/NavServlet.java3
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/ShowInTocFilter.java10
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/utils/Utils.java5
-rw-r--r--org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/linkchecker/AddScriptFilter.java12
-rw-r--r--org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java3
-rw-r--r--org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/XMLUtil.java7
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/dynamic/DynamicXHTMLProcessorTest.java3
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/RemoteTestUtils.java3
-rw-r--r--org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/CheatSheetPlugin.java7
-rw-r--r--org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/contentdetect/ContentDetectHelper.java5
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/ReopenUtil.java7
32 files changed, 87 insertions, 85 deletions
diff --git a/org.eclipse.help.base/src/org/eclipse/help/internal/browser/BrowserLog.java b/org.eclipse.help.base/src/org/eclipse/help/internal/browser/BrowserLog.java
index dac1f1c45..a62c5e85c 100644
--- a/org.eclipse.help.base/src/org/eclipse/help/internal/browser/BrowserLog.java
+++ b/org.eclipse.help.base/src/org/eclipse/help/internal/browser/BrowserLog.java
@@ -10,12 +10,17 @@
*******************************************************************************/
package org.eclipse.help.internal.browser;
-import java.io.*;
-import com.ibm.icu.text.DateFormat;
-import com.ibm.icu.text.SimpleDateFormat;
+import java.io.BufferedWriter;
+import java.io.FileOutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.nio.charset.StandardCharsets;
import java.util.Date;
-import org.eclipse.help.internal.base.*;
+import org.eclipse.help.internal.base.HelpBasePlugin;
+
+import com.ibm.icu.text.DateFormat;
+import com.ibm.icu.text.SimpleDateFormat;
/**
* Log for messages output by external browser processes.
@@ -59,7 +64,7 @@ public class BrowserLog {
return;
}
try (Writer outWriter = new BufferedWriter(
- new OutputStreamWriter(new FileOutputStream(logFileName, true), "UTF-8"))) { //$NON-NLS-1$
+ new OutputStreamWriter(new FileOutputStream(logFileName, true), StandardCharsets.UTF_8))) {
if (newSession) {
newSession = false;
outWriter.write(LN + formatter.format(new Date())
diff --git a/org.eclipse.help.base/src/org/eclipse/help/internal/search/InfoCenter.java b/org.eclipse.help.base/src/org/eclipse/help/internal/search/InfoCenter.java
index f9c5b1b5d..acdd67997 100644
--- a/org.eclipse.help.base/src/org/eclipse/help/internal/search/InfoCenter.java
+++ b/org.eclipse.help.base/src/org/eclipse/help/internal/search/InfoCenter.java
@@ -12,6 +12,7 @@ package org.eclipse.help.internal.search;
import java.io.*;
import java.net.*;
+import java.nio.charset.StandardCharsets;
import java.util.Hashtable;
import javax.xml.parsers.*;
@@ -172,7 +173,7 @@ public final class InfoCenter implements ISearchEngine {
URLConnection connection = ProxyUtil.getConnection(url);
monitor.beginTask(HelpBaseResources.InfoCenter_connecting, 5);
is = connection.getInputStream();
- try (BufferedReader reader = new BufferedReader(new InputStreamReader(is, "utf-8"))) {//$NON-NLS-1$
+ try (BufferedReader reader = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) {
monitor.worked(1);
load(((Scope) scope).url, reader, collector, new SubProgressMonitor(monitor, 4));
}
diff --git a/org.eclipse.help.base/src/org/eclipse/help/internal/workingset/WorkingSetManager.java b/org.eclipse.help.base/src/org/eclipse/help/internal/workingset/WorkingSetManager.java
index 56edb4ac0..604006023 100644
--- a/org.eclipse.help.base/src/org/eclipse/help/internal/workingset/WorkingSetManager.java
+++ b/org.eclipse.help.base/src/org/eclipse/help/internal/workingset/WorkingSetManager.java
@@ -15,6 +15,7 @@ import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
@@ -205,7 +206,7 @@ public class WorkingSetManager implements IHelpWorkingSetManager {
if (stateFile.exists()) {
try (FileInputStream input = new FileInputStream(stateFile);
- InputStreamReader reader = new InputStreamReader(input, "utf-8")) { //$NON-NLS-1$
+ InputStreamReader reader = new InputStreamReader(input, StandardCharsets.UTF_8)) {
InputSource inputSource = new InputSource(reader);
inputSource.setSystemId(stateFile.toString());
diff --git a/org.eclipse.help.base/src/org/eclipse/help/search/HelpIndexBuilder.java b/org.eclipse.help.base/src/org/eclipse/help/search/HelpIndexBuilder.java
index 7ef2bbb2c..097400ab2 100644
--- a/org.eclipse.help.base/src/org/eclipse/help/search/HelpIndexBuilder.java
+++ b/org.eclipse.help.base/src/org/eclipse/help/search/HelpIndexBuilder.java
@@ -16,6 +16,7 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
+import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
@@ -728,7 +729,7 @@ public class HelpIndexBuilder {
private Document readXMLFile(File file) throws CoreException {
Document d = null;
try (InputStream stream = new FileInputStream(file);
- InputStreamReader reader = new InputStreamReader(stream, "utf-8")) { //$NON-NLS-1$
+ InputStreamReader reader = new InputStreamReader(stream, StandardCharsets.UTF_8)) {
InputSource inputSource = new InputSource(reader);
inputSource.setSystemId(manifest.toString());
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/StatusProducer.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/StatusProducer.java
index 692a1e1d2..1e0a6743b 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/StatusProducer.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/StatusProducer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2015 IBM Corporation and others.
+ * Copyright (c) 2009, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,9 +14,9 @@ package org.eclipse.help.internal.webapp;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
+import java.nio.charset.StandardCharsets;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Locale;
@@ -408,12 +408,7 @@ public class StatusProducer implements IHelpContentProducer {
}
private static InputStream getBytes(StringBuffer pageBuffer) {
- try {
- return new ByteArrayInputStream(pageBuffer.toString().getBytes("UTF-8")); //$NON-NLS-1$
- } catch (UnsupportedEncodingException e) {
- HelpWebappPlugin.logError("JRE error: UTF-8 encoding not supported", e); //$NON-NLS-1$
- return new ByteArrayInputStream(pageBuffer.toString().getBytes());
- }
+ return new ByteArrayInputStream(pageBuffer.toString().getBytes(StandardCharsets.UTF_8));
}
}
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/AboutService.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/AboutService.java
index 9f40cd321..984a65faf 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/AboutService.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/AboutService.java
@@ -13,6 +13,7 @@ package org.eclipse.help.internal.webapp.service;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
@@ -106,7 +107,7 @@ public class AboutService extends AboutServlet {
throws IOException {
AboutParser aboutParser = new AboutParser(service);
if (response != null) {
- try (InputStream is = new ByteArrayInputStream(response.getBytes("UTF-8"))) { //$NON-NLS-1$
+ try (InputStream is = new ByteArrayInputStream(response.getBytes(StandardCharsets.UTF_8))) {
aboutParser.parse(is);
} catch (Exception e) {
e.printStackTrace();
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/AdvancedSearchService.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/AdvancedSearchService.java
index 05ad7e58c..e2ffbdbd8 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/AdvancedSearchService.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/AdvancedSearchService.java
@@ -13,6 +13,7 @@ package org.eclipse.help.internal.webapp.service;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@@ -116,7 +117,7 @@ public class AdvancedSearchService extends HttpServlet {
SearchParser searchParser = new SearchParser();
if (response != null) {
- try (InputStream is = new ByteArrayInputStream(response.getBytes("UTF-8"))) { //$NON-NLS-1$
+ try (InputStream is = new ByteArrayInputStream(response.getBytes(StandardCharsets.UTF_8))) {
searchParser.parse(is);
} catch (Exception e) {
e.printStackTrace();
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/ContentService.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/ContentService.java
index 4af02d0ca..d596a4efb 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/ContentService.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/ContentService.java
@@ -17,6 +17,7 @@ import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.URL;
import java.net.URLConnection;
+import java.nio.charset.StandardCharsets;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@@ -82,7 +83,7 @@ public class ContentService extends HttpServlet {
} else {
String response = Utils.convertStreamToString(ProxyUtil.getStream(url));
response = Utils.updateResponse(response);
- try (PrintWriter writer = new PrintWriter(new OutputStreamWriter(out, "UTF-8"))) { //$NON-NLS-1$
+ try (PrintWriter writer = new PrintWriter(new OutputStreamWriter(out, StandardCharsets.UTF_8))) {
writer.write(response);
}
}
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/ContextService.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/ContextService.java
index 0156a59db..0c67087ff 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/ContextService.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/ContextService.java
@@ -13,6 +13,7 @@ package org.eclipse.help.internal.webapp.service;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@@ -88,7 +89,7 @@ public class ContextService extends ContextServlet {
throws IOException {
ContextParser searchParser = new ContextParser();
if (response != null) {
- try (InputStream is = new ByteArrayInputStream(response.getBytes("UTF-8"))) { //$NON-NLS-1$
+ try (InputStream is = new ByteArrayInputStream(response.getBytes(StandardCharsets.UTF_8))) {
searchParser.parse(is);
} catch (Exception e) {
e.printStackTrace();
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/ExtensionService.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/ExtensionService.java
index 4373b7d14..6947bcf66 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/ExtensionService.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/ExtensionService.java
@@ -13,6 +13,7 @@ package org.eclipse.help.internal.webapp.service;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@@ -76,7 +77,7 @@ public class ExtensionService extends ExtensionServlet {
throws IOException {
ExtensionParser searchParser = new ExtensionParser();
if (response != null) {
- try (InputStream is = new ByteArrayInputStream(response.getBytes("UTF-8"))) { //$NON-NLS-1$
+ try (InputStream is = new ByteArrayInputStream(response.getBytes(StandardCharsets.UTF_8))) {
searchParser.parse(is);
} catch (Exception e) {
e.printStackTrace();
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/IndexFragmentService.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/IndexFragmentService.java
index fd6aad7e6..db9721c2d 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/IndexFragmentService.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/IndexFragmentService.java
@@ -13,6 +13,7 @@ package org.eclipse.help.internal.webapp.service;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@@ -91,7 +92,7 @@ public class IndexFragmentService extends IndexFragmentServlet {
throws IOException {
IndexFragmentParser indexParser = new IndexFragmentParser();
if (response != null) {
- try (InputStream is = new ByteArrayInputStream(response.getBytes("UTF-8"))) { //$NON-NLS-1$
+ try (InputStream is = new ByteArrayInputStream(response.getBytes(StandardCharsets.UTF_8))) {
indexParser.parse(is);
} catch (Exception e) {
e.printStackTrace();
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/IndexService.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/IndexService.java
index f28afeab9..8c9a306a5 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/IndexService.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/IndexService.java
@@ -13,6 +13,7 @@ package org.eclipse.help.internal.webapp.service;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@@ -78,7 +79,7 @@ public class IndexService extends IndexServlet {
throws IOException {
IndexParser indexParser = new IndexParser();
if (response != null) {
- try (InputStream is = new ByteArrayInputStream(response.getBytes("UTF-8"))) { //$NON-NLS-1$
+ try (InputStream is = new ByteArrayInputStream(response.getBytes(StandardCharsets.UTF_8))) {
indexParser.parse(is);
} catch (Exception e) {
e.printStackTrace();
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/NavService.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/NavService.java
index d7d127730..1ed3acc9c 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/NavService.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/NavService.java
@@ -17,6 +17,7 @@ import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.URL;
+import java.nio.charset.StandardCharsets;
import java.util.Locale;
import javax.servlet.ServletException;
@@ -110,7 +111,7 @@ public class NavService extends NavServlet {
response = Utils.updateResponse(response);
OutputStream out = resp.getOutputStream();
- try (PrintWriter writer = new PrintWriter(new OutputStreamWriter(out, "UTF-8"))) { //$NON-NLS-1$
+ try (PrintWriter writer = new PrintWriter(new OutputStreamWriter(out, StandardCharsets.UTF_8))) {
writer.write(response);
}
}
@@ -119,7 +120,7 @@ public class NavService extends NavServlet {
throws IOException {
NavParser navParser = new NavParser();
if (response != null) {
- try (InputStream is = new ByteArrayInputStream(response.getBytes("UTF-8"))) { //$NON-NLS-1$
+ try (InputStream is = new ByteArrayInputStream(response.getBytes(StandardCharsets.UTF_8))) {
navParser.parse(is);
} catch (Exception e) {
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/SearchService.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/SearchService.java
index 06dda3e06..fd62785b0 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/SearchService.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/SearchService.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2015 IBM Corporation and others.
+ * Copyright (c) 2011, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,6 +13,7 @@ package org.eclipse.help.internal.webapp.service;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@@ -81,7 +82,7 @@ public class SearchService extends SearchServlet {
throws IOException {
SearchParser searchParser = new SearchParser();
if (response != null) {
- try (InputStream is = new ByteArrayInputStream(response.getBytes("UTF-8"))) { //$NON-NLS-1$
+ try (InputStream is = new ByteArrayInputStream(response.getBytes(StandardCharsets.UTF_8))) {
searchParser.parse(is);
} catch (Exception e) {
e.printStackTrace();
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/TocFragmentService.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/TocFragmentService.java
index 39091b360..2bdbe9aae 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/TocFragmentService.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/TocFragmentService.java
@@ -13,6 +13,7 @@ package org.eclipse.help.internal.webapp.service;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@@ -85,7 +86,7 @@ public class TocFragmentService extends TocFragmentServlet {
throws IOException {
TocFragmentParser tocParser = new TocFragmentParser();
if (xmlResource != null) {
- try (InputStream is = new ByteArrayInputStream(xmlResource.getBytes("UTF-8"))) { //$NON-NLS-1$
+ try (InputStream is = new ByteArrayInputStream(xmlResource.getBytes(StandardCharsets.UTF_8))) {
int level = 0;
if (toc != null && toc.length() > 0) {
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/TocService.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/TocService.java
index 616e069c3..d0041711c 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/TocService.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/service/TocService.java
@@ -13,6 +13,7 @@ package org.eclipse.help.internal.webapp.service;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@@ -77,7 +78,7 @@ public class TocService extends TocServlet {
throws IOException {
TocParser tocParser = new TocParser();
if (response != null) {
- try (InputStream is = new ByteArrayInputStream(response.getBytes("UTF-8"))) { //$NON-NLS-1$
+ try (InputStream is = new ByteArrayInputStream(response.getBytes(StandardCharsets.UTF_8))) {
tocParser.parse(is);
} catch (Exception e) {
e.printStackTrace();
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/BreadcrumbsFilter.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/BreadcrumbsFilter.java
index d7f4556f0..09b73530d 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/BreadcrumbsFilter.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/BreadcrumbsFilter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2015 IBM Corporation and others.
+ * Copyright (c) 2007, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,6 +11,7 @@
package org.eclipse.help.internal.webapp.servlet;
import java.io.OutputStream;
+import java.nio.charset.StandardCharsets;
import javax.servlet.http.HttpServletRequest;
@@ -84,7 +85,7 @@ public class BreadcrumbsFilter implements IFilter {
String headContent = HEAD_CONTENT1 + backpath + HEAD_CONTENT2 + backpath +
HEAD_CONTENT3;
return new FilterHTMLHeadAndBodyOutputStream(out, headContent
- .getBytes("ASCII"), bodyContent); //$NON-NLS-1$
+ .getBytes(StandardCharsets.US_ASCII), bodyContent);
}
catch (Exception e) {
return out;
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/DynamicXHTMLFilter.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/DynamicXHTMLFilter.java
index 6a6ae696d..24db98652 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/DynamicXHTMLFilter.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/DynamicXHTMLFilter.java
@@ -18,6 +18,7 @@ import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.StringWriter;
+import java.nio.charset.StandardCharsets;
import javax.servlet.http.HttpServletRequest;
@@ -36,7 +37,6 @@ public class DynamicXHTMLFilter implements IFilter {
private static final String ERROR_PAGE_PREFIX = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\">\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n</head>\n<body>"; //$NON-NLS-1$
private static final String ERROR_PAGE_SUFFIX = "</body>\n</html>"; //$NON-NLS-1$
- private static final String CHARSET_UTF8 = "UTF-8"; //$NON-NLS-1$
/* (non-Javadoc)
* @see org.eclipse.help.internal.webapp.servlet.IFilter#filter(javax.servlet.http.HttpServletRequest, java.io.OutputStream)
@@ -86,7 +86,7 @@ public class DynamicXHTMLFilter implements IFilter {
out.close();
}
catch (Throwable t) {
- try (PrintWriter writer = new PrintWriter(new OutputStreamWriter(out, CHARSET_UTF8))) {
+ try (PrintWriter writer = new PrintWriter(new OutputStreamWriter(out, StandardCharsets.UTF_8))) {
writer.println(ERROR_PAGE_PREFIX);
writer.println("<p>"); //$NON-NLS-1$
writer.println(WebappResources.getString("ProcessingError", req.getLocale())); //$NON-NLS-1$
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/FramesetFilter.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/FramesetFilter.java
index 66419d52f..7495b659b 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/FramesetFilter.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/FramesetFilter.java
@@ -13,6 +13,7 @@ package org.eclipse.help.internal.webapp.servlet;
import java.io.*;
import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
import javax.servlet.http.*;
@@ -84,11 +85,6 @@ public class FramesetFilter implements IFilter {
}
script.append(scriptPart3);
- try {
- return new FilterHTMLHeadOutputStream(out, script.toString()
- .getBytes("ASCII")); //$NON-NLS-1$
- } catch (UnsupportedEncodingException uee) {
- return out;
- }
+ return new FilterHTMLHeadOutputStream(out, script.toString().getBytes(StandardCharsets.US_ASCII));
}
}
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/HighlightFilter.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/HighlightFilter.java
index 8ab6b713f..46b54d684 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/HighlightFilter.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/HighlightFilter.java
@@ -12,6 +12,7 @@
package org.eclipse.help.internal.webapp.servlet;
import java.io.*;
+import java.nio.charset.StandardCharsets;
import java.util.*;
import javax.servlet.http.*;
@@ -90,11 +91,7 @@ public class HighlightFilter implements IFilter {
buf.append(scriptPart5);
buf.append(buf2.toString());
buf.append(sheetRefPart3);
- try {
- return buf.toString().getBytes("ASCII"); //$NON-NLS-1$
- } catch (UnsupportedEncodingException uee) {
- return new byte[0];
- }
+ return buf.toString().getBytes(StandardCharsets.US_ASCII);
}
/**
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/InjectionFilter.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/InjectionFilter.java
index 7979eb166..0ee8fe3ac 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/InjectionFilter.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/InjectionFilter.java
@@ -12,7 +12,7 @@
package org.eclipse.help.internal.webapp.servlet;
import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
@@ -111,13 +111,8 @@ public class InjectionFilter implements IFilter {
}
appendDisabled(disabledContent, upLevels, addNarrow, relativePath);
}
- try {
- return new FilterHTMLHeadAndBodyOutputStream(
- out,
- script.toString().getBytes("ASCII"), addDisabled ? disabledContent.toString() : null); //$NON-NLS-1$
- } catch (UnsupportedEncodingException uee) {
- return out;
- }
+ return new FilterHTMLHeadAndBodyOutputStream(out,
+ script.toString().getBytes(StandardCharsets.US_ASCII), addDisabled ? disabledContent.toString() : null);
}
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/NavServlet.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/NavServlet.java
index 4a169a9f6..66fbf2779 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/NavServlet.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/NavServlet.java
@@ -14,6 +14,7 @@ import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
+import java.nio.charset.StandardCharsets;
import java.util.Locale;
import java.util.StringTokenizer;
@@ -71,7 +72,7 @@ public class NavServlet extends HttpServlet {
out = filter.filter(req, out);
}
- try (PrintWriter writer = new PrintWriter(new OutputStreamWriter(out, "UTF-8"))) { //$NON-NLS-1$
+ try (PrintWriter writer = new PrintWriter(new OutputStreamWriter(out, StandardCharsets.UTF_8))) {
AbstractHelpScope scope = RequestScope.getScope(req, resp, false);
writeContent(topic, path, locale, writer, UrlUtil.isRTL(req, resp), scope);
}
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/ShowInTocFilter.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/ShowInTocFilter.java
index 511c57845..0a12b54c8 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/ShowInTocFilter.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/ShowInTocFilter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,6 +12,7 @@
package org.eclipse.help.internal.webapp.servlet;
import java.io.*;
+import java.nio.charset.StandardCharsets;
import javax.servlet.http.*;
@@ -57,12 +58,7 @@ public class ShowInTocFilter implements IFilter {
script.append(relativePath);
script.append(scriptPart3);
- try {
- return new FilterHTMLHeadOutputStream(out, script.toString()
- .getBytes("ASCII")); //$NON-NLS-1$
- } catch (UnsupportedEncodingException uee) {
- return out;
- }
+ return new FilterHTMLHeadOutputStream(out, script.toString().getBytes(StandardCharsets.US_ASCII));
}
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/utils/Utils.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/utils/Utils.java
index 04a3495e2..2a1eee0ef 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/utils/Utils.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/utils/Utils.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2015 IBM Corporation and others.
+ * Copyright (c) 2011, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,6 +19,7 @@ import java.io.OutputStream;
import java.io.Reader;
import java.io.StringWriter;
import java.io.Writer;
+import java.nio.charset.StandardCharsets;
public class Utils {
@@ -44,7 +45,7 @@ public class Utils {
char[] buffer = new char[1024];
try {
Reader reader = new BufferedReader(
- new InputStreamReader(is, "UTF-8")); //$NON-NLS-1$
+ new InputStreamReader(is, StandardCharsets.UTF_8));
int n;
while ((n = reader.read(buffer)) != -1) {
writer.write(buffer, 0, n);
diff --git a/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/linkchecker/AddScriptFilter.java b/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/linkchecker/AddScriptFilter.java
index 28cd392ea..8c7ac01a4 100644
--- a/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/linkchecker/AddScriptFilter.java
+++ b/org.eclipse.ua.tests.doc/src/org/eclipse/ua/tests/doc/internal/linkchecker/AddScriptFilter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2015 IBM Corporation and others.
+ * Copyright (c) 2009, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,7 +12,7 @@
package org.eclipse.ua.tests.doc.internal.linkchecker;
import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
import javax.servlet.http.HttpServletRequest;
@@ -36,13 +36,7 @@ public class AddScriptFilter implements IFilter {
script.append(relativePath);
script.append("content/org.eclipse.ua.tests.doc/checkdoc.js\"> </script>"); //$NON-NLS-1$
- try {
- return new FilterHTMLHeadOutputStream(
- out,
- script.toString().getBytes("ASCII")); //$NON-NLS-1$
- } catch (UnsupportedEncodingException uee) {
- return out;
- }
+ return new FilterHTMLHeadOutputStream(out, script.toString().getBytes(StandardCharsets.US_ASCII));
}
}
diff --git a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java
index 4e35b0fee..87ae0dd6f 100644
--- a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java
+++ b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java
@@ -15,6 +15,7 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
+import java.nio.charset.StandardCharsets;
import org.osgi.framework.Bundle;
@@ -64,7 +65,7 @@ public class FileUtil {
while ((num = in.read(buffer)) > 0) {
out.write(buffer, 0, num);
}
- String result = new String(out.toByteArray(), "UTF-8");
+ String result = new String(out.toByteArray(), StandardCharsets.UTF_8);
if (result.length() > 0) {
// filter windows-specific newline
result = result.replaceAll("\r", "");
diff --git a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/XMLUtil.java b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/XMLUtil.java
index 6833e4a83..b9fb8e94f 100644
--- a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/XMLUtil.java
+++ b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/XMLUtil.java
@@ -14,6 +14,7 @@ import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
+import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
@@ -36,8 +37,8 @@ import org.xml.sax.helpers.DefaultHandler;
public class XMLUtil extends Assert {
public static void assertXMLEquals(String msg, String s1, String s2) throws Exception {
- InputStream in1 = new ByteArrayInputStream(s1.getBytes("UTF-8"));
- InputStream in2 = new ByteArrayInputStream(s2.getBytes("UTF-8"));
+ InputStream in1 = new ByteArrayInputStream(s1.getBytes(StandardCharsets.UTF_8));
+ InputStream in2 = new ByteArrayInputStream(s2.getBytes(StandardCharsets.UTF_8));
assertXMLEquals(msg, in1, in2);
}
@@ -49,7 +50,7 @@ public class XMLUtil extends Assert {
public static void assertParseableXML(String s) {
try {
- InputStream in1 = new ByteArrayInputStream(s.getBytes("UTF-8"));
+ InputStream in1 = new ByteArrayInputStream(s.getBytes(StandardCharsets.UTF_8));
process(in1);
} catch (Exception e) {
fail("Unable to parse source: " + s);
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/dynamic/DynamicXHTMLProcessorTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/dynamic/DynamicXHTMLProcessorTest.java
index 7038662aa..236faa61f 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/dynamic/DynamicXHTMLProcessorTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/dynamic/DynamicXHTMLProcessorTest.java
@@ -15,6 +15,7 @@ import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerConfigurationException;
@@ -54,7 +55,7 @@ public class DynamicXHTMLProcessorTest {
}
private String readStream(InputStream is) throws Exception {
- try (InputStreamReader inputStreamReader = new InputStreamReader(is, "UTF-8")) {
+ try (InputStreamReader inputStreamReader = new InputStreamReader(is, StandardCharsets.UTF_8)) {
StringBuffer buffer = new StringBuffer();
char[] cbuf = new char[256];
int len;
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/RemoteTestUtils.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/RemoteTestUtils.java
index bbf79b072..288d85bb8 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/RemoteTestUtils.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/remote/RemoteTestUtils.java
@@ -16,6 +16,7 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.URL;
+import java.nio.charset.StandardCharsets;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
@@ -56,7 +57,7 @@ public class RemoteTestUtils {
public static String readFromURL(URL url) throws IOException,
UnsupportedEncodingException {
try (InputStream is = url.openStream();
- InputStreamReader inputStreamReader = new InputStreamReader(is, "UTF-8")) {
+ InputStreamReader inputStreamReader = new InputStreamReader(is, StandardCharsets.UTF_8)) {
StringBuffer buffer = new StringBuffer();
char[] cbuf = new char[256];
int len;
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/CheatSheetPlugin.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/CheatSheetPlugin.java
index c1fc408ae..4d0eb6713 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/CheatSheetPlugin.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/CheatSheetPlugin.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2002, 2015 IBM Corporation and others.
+ * Copyright (c) 2002, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,6 +18,7 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL;
+import java.nio.charset.StandardCharsets;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@@ -274,7 +275,7 @@ public class CheatSheetPlugin extends AbstractUIPlugin {
final File stateFile = getCheatSheetStateFile(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);
@@ -342,7 +343,7 @@ public class CheatSheetPlugin extends AbstractUIPlugin {
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);
return Status.OK_STATUS;
} catch (IOException e) {
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();
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/ReopenUtil.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/ReopenUtil.java
index eef39a1dc..f99665a51 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/ReopenUtil.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/ReopenUtil.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation and others.
+ * Copyright (c) 2009, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,6 +18,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
+import java.nio.charset.StandardCharsets;
import org.eclipse.core.runtime.IPath;
import org.eclipse.ui.XMLMemento;
@@ -60,7 +61,7 @@ public class ReopenUtil {
final File stateFile = getStateFile();
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);
@@ -86,7 +87,7 @@ public class ReopenUtil {
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