diff options
author | Alexander Kurtakov | 2018-01-19 12:44:48 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2018-01-19 13:00:50 +0000 |
commit | 77554b90d256f072212d58557f4686884a8bed2b (patch) | |
tree | 0735cbcae2bf976fda9901d142a472187ea1e4e1 | |
parent | 3dc65fbd62daa08bb5700a0dd70c5950caab423d (diff) | |
download | eclipse.platform.team-I20180123-1010.tar.gz eclipse.platform.team-I20180123-1010.tar.xz eclipse.platform.team-I20180123-1010.zip |
Remove useless throws.S4_8_0_M5I20180124-2000I20180124-0800I20180123-2000I20180123-1010I20180123-0800I20180122-2000I20180122-0800I20180121-2000I20180121-0800I20180120-1500I20180120-0800I20180119-2000
Of UnsupportedEncodingException.
Change-Id: I4b319dbe9ec446eda138c72902f29ca1d4471b06
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r-- | bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/XMLWriter.java | 4 | ||||
-rw-r--r-- | tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/StreamMergerTest.java | 30 |
2 files changed, 15 insertions, 19 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/XMLWriter.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/XMLWriter.java index 506750a70..4d9092db0 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/XMLWriter.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/XMLWriter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. + * Copyright (c) 2000, 2018 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 @@ -25,7 +25,7 @@ public class XMLWriter extends PrintWriter { /* constants */ protected static final String XML_VERSION = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; //$NON-NLS-1$ -public XMLWriter(OutputStream output) throws UnsupportedEncodingException { +public XMLWriter(OutputStream output) { super(new OutputStreamWriter(output, StandardCharsets.UTF_8)); tab = 0; println(XML_VERSION); diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/StreamMergerTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/StreamMergerTest.java index 375406f97..34b4ecb98 100644 --- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/StreamMergerTest.java +++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/StreamMergerTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. + * Copyright (c) 2000, 2018 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 @@ -10,19 +10,16 @@ *******************************************************************************/ package org.eclipse.compare.tests; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; +import java.io.*; import java.nio.charset.StandardCharsets; -import junit.framework.TestCase; - import org.eclipse.compare.IStreamMerger; import org.eclipse.compare.internal.merge.TextStreamMerger; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import junit.framework.TestCase; + public class StreamMergerTest extends TestCase { private static final String ABC= "abc"; //$NON-NLS-1$ @@ -40,7 +37,7 @@ public class StreamMergerTest extends TestCase { super(name); } - public void testIncomingAddition() throws UnsupportedEncodingException { + public void testIncomingAddition() { String a= ABC + SEPARATOR + DEF + SEPARATOR + XYZ; String t= ABC + SEPARATOR + DEF + SEPARATOR + XYZ; @@ -55,7 +52,7 @@ public class StreamMergerTest extends TestCase { assertEquals(output.toString(), ABC + SEPARATOR + DEF + SEPARATOR + _123 + SEPARATOR + XYZ + SEPARATOR); } - public void testIncomingDeletion() throws UnsupportedEncodingException { + public void testIncomingDeletion() { String a= ABC + SEPARATOR + DEF + SEPARATOR + XYZ; String t= ABC + SEPARATOR + DEF + SEPARATOR + XYZ; @@ -70,7 +67,7 @@ public class StreamMergerTest extends TestCase { assertEquals(output.toString(), ABC + SEPARATOR + XYZ + SEPARATOR); } - public void testIncomingReplacement() throws UnsupportedEncodingException { + public void testIncomingReplacement() { String a= ABC + SEPARATOR + DEF + SEPARATOR + XYZ; String t= ABC + SEPARATOR + DEF + SEPARATOR + XYZ; @@ -85,7 +82,7 @@ public class StreamMergerTest extends TestCase { assertEquals(output.toString(), ABC + SEPARATOR + _123 + SEPARATOR + XYZ + SEPARATOR); } - public void testNonConflictingMerge() throws UnsupportedEncodingException { + public void testNonConflictingMerge() { String a= ABC + SEPARATOR + DEF + SEPARATOR + XYZ; String t= ABC + SEPARATOR + DEF + SEPARATOR + XYZ + SEPARATOR + FOO; @@ -100,7 +97,7 @@ public class StreamMergerTest extends TestCase { assertEquals(output.toString(), ABC + SEPARATOR + _123 + SEPARATOR + _456 + SEPARATOR + XYZ + SEPARATOR + FOO + SEPARATOR); } - public void testConflictingReplacement() throws UnsupportedEncodingException { + public void testConflictingReplacement() { String a= ABC + SEPARATOR + DEF + SEPARATOR + XYZ; String t= ABC + SEPARATOR + FOO + SEPARATOR + XYZ; @@ -114,7 +111,7 @@ public class StreamMergerTest extends TestCase { assertEquals(status.getCode(), IStreamMerger.CONFLICT); } - public void testConflictingAddition() throws UnsupportedEncodingException { + public void testConflictingAddition() { String a= ABC + SEPARATOR + DEF + SEPARATOR + XYZ; String t= ABC + SEPARATOR + DEF + SEPARATOR + _123 + SEPARATOR + XYZ; @@ -129,7 +126,7 @@ public class StreamMergerTest extends TestCase { assertEquals(output.toString(), ABC + SEPARATOR + DEF + SEPARATOR + _123 + SEPARATOR + XYZ + SEPARATOR); } - public void testConflictingDeletion() throws UnsupportedEncodingException { + public void testConflictingDeletion() { String a= ABC + SEPARATOR + DEF + SEPARATOR + XYZ; String t= ABC + SEPARATOR + XYZ; @@ -144,7 +141,7 @@ public class StreamMergerTest extends TestCase { assertEquals(output.toString(), ABC + SEPARATOR + XYZ + SEPARATOR); } - private IStatus merge(StringBuffer output, String a, String m, String y) throws UnsupportedEncodingException { + private IStatus merge(StringBuffer output, String a, String m, String y) { InputStream ancestor= new ByteArrayInputStream(a.getBytes(StandardCharsets.UTF_8)); InputStream target= new ByteArrayInputStream(m.getBytes(StandardCharsets.UTF_8)); InputStream other= new ByteArrayInputStream(y.getBytes(StandardCharsets.UTF_8)); @@ -153,8 +150,7 @@ public class StreamMergerTest extends TestCase { } private IStatus merge(StringBuffer output, InputStream ancestor, - InputStream target, InputStream other) - throws UnsupportedEncodingException { + InputStream target, InputStream other) { ByteArrayOutputStream os= new ByteArrayOutputStream(); IStreamMerger merger= new TextStreamMerger(); |