Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2018-03-14 06:31:51 +0000
committerFred Bricon2018-03-15 13:01:26 +0000
commitebef92f5e2f18310d65328ea2f5b96c8ec89708b (patch)
treee7e3cedee667121c5c58fc8f828941781cc9cd8d /org.eclipse.m2e.editor
parenta4f8dc7748d38e08d01103be454f48c8b50cc2f3 (diff)
downloadm2e-core-ebef92f5e2f18310d65328ea2f5b96c8ec89708b.tar.gz
m2e-core-ebef92f5e2f18310d65328ea2f5b96c8ec89708b.tar.xz
m2e-core-ebef92f5e2f18310d65328ea2f5b96c8ec89708b.zip
Use StandardCharsets.
It allowed even removing guava dep from m2e.launching. Change-Id: Ieaa91358fcfa3c9b7f40f0a6197eddd6a9522c48 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'org.eclipse.m2e.editor')
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java
index efa64035..eb051176 100644
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java
@@ -13,7 +13,7 @@ package org.eclipse.m2e.editor.pom;
import java.io.IOException;
import java.io.StringWriter;
-import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -297,10 +297,12 @@ public class MavenPomEditor extends FormEditor implements IResourceChangeListene
try {
IMarker[] markers = pomFile.findMarkers(IMavenConstants.MARKER_ID, true, IResource.DEPTH_ZERO);
final String msg = markers != null && markers.length > 0 //
- ? markers[0].getAttribute(IMarker.MESSAGE, "Unknown error") : null;
+ ? markers[0].getAttribute(IMarker.MESSAGE, "Unknown error")
+ : null;
final int severity = markers != null && markers.length > 0
? (markers[0].getAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR) == IMarker.SEVERITY_WARNING
- ? IMessageProvider.WARNING : IMessageProvider.ERROR)
+ ? IMessageProvider.WARNING
+ : IMessageProvider.ERROR)
: IMessageProvider.NONE;
Display.getDefault().asyncExec(new Runnable() {
@@ -517,11 +519,7 @@ public class MavenPomEditor extends FormEditor implements IResourceChangeListene
if(effectivePomEditorInput == null) {
String content = Messages.MavenPomEditor_loading;
String name = getPartName() + Messages.MavenPomEditor_effective;
- try {
- effectivePomEditorInput = new MavenStorageEditorInput(name, name, null, content.getBytes("UTF-8"));
- } catch(UnsupportedEncodingException e) {
- effectivePomEditorInput = new MavenStorageEditorInput(name, name, null, content.getBytes());
- }
+ effectivePomEditorInput = new MavenStorageEditorInput(name, name, null, content.getBytes(StandardCharsets.UTF_8));
}
return effectivePomEditorInput;
}

Back to the top