Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2019-10-08 02:30:44 -0400
committerAlexander Kurtakov2019-10-08 02:31:54 -0400
commit8e6bf130deeea916e8bf70ebac93768200f966c4 (patch)
tree822c6f40851a4bd89e1f5a8c0420bdef5127d472
parentc01c68a4768a6f24a671985e3cc1acaddc38a976 (diff)
downloadrt.equinox.framework-8e6bf130deeea916e8bf70ebac93768200f966c4.tar.gz
rt.equinox.framework-8e6bf130deeea916e8bf70ebac93768200f966c4.tar.xz
rt.equinox.framework-8e6bf130deeea916e8bf70ebac93768200f966c4.zip
Instead of string name "UTF-8". Change-Id: I724c60e5c074e7593b17bd24385a5e40023fcf94 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/MultiReleaseJarTests.java12
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/TestModuleContainer.java3
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/debugoptions/DebugOptionsTestCase.java36
3 files changed, 35 insertions, 16 deletions
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/MultiReleaseJarTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/MultiReleaseJarTests.java
index 5fe600be7..00956fc3a 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/MultiReleaseJarTests.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/MultiReleaseJarTests.java
@@ -21,7 +21,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
-import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -115,7 +115,7 @@ public class MultiReleaseJarTests extends AbstractBundleTests {
bundleEntries.put("multi/release/test/testResource11.txt", getBytes("multi/release/test/testResource11.txt", base));
bundleEntries.put("META-INF/services/", null);
- bundleEntries.put("META-INF/services/multi.release.test.TestService", "multi.release.test.TestServiceBase".getBytes("UTF-8"));
+ bundleEntries.put("META-INF/services/multi.release.test.TestService", "multi.release.test.TestServiceBase".getBytes(StandardCharsets.UTF_8));
bundleEntries.put("META-INF/versions/", null);
bundleEntries.put("META-INF/versions/8/", null);
bundleEntries.put("META-INF/versions/8/multi/", null);
@@ -127,11 +127,11 @@ public class MultiReleaseJarTests extends AbstractBundleTests {
bundleEntries.put("META-INF/versions/8/multi/release/test/testResourceAdd8.txt", getBytes("multi/release/test/testResourceAdd8.txt", base));
bundleEntries.put("META-INF/versions/9/", null);
bundleEntries.put("META-INF/versions/9/META-INF/", null);
- bundleEntries.put("META-INF/versions/9/META-INF/addedFor9.txt", "added for 9".getBytes("UTF-8"));
+ bundleEntries.put("META-INF/versions/9/META-INF/addedFor9.txt", "added for 9".getBytes(StandardCharsets.UTF_8));
bundleEntries.put("META-INF/versions/9/META-INF/addedDirFor9/", null);
- bundleEntries.put("META-INF/versions/9/META-INF/addedDirFor9/addedFor9.txt", "added for 9".getBytes("UTF-8"));
+ bundleEntries.put("META-INF/versions/9/META-INF/addedDirFor9/addedFor9.txt", "added for 9".getBytes(StandardCharsets.UTF_8));
bundleEntries.put("META-INF/versions/9/META-INF/services/", null);
- bundleEntries.put("META-INF/versions/9/META-INF/services/multi.release.test.TestService", "multi.release.test.TestService9".getBytes("UTF-8"));
+ bundleEntries.put("META-INF/versions/9/META-INF/services/multi.release.test.TestService", "multi.release.test.TestService9".getBytes(StandardCharsets.UTF_8));
bundleEntries.put("META-INF/versions/9/multi/", null);
bundleEntries.put("META-INF/versions/9/multi/release/", null);
bundleEntries.put("META-INF/versions/9/multi/release/test/", null);
@@ -246,7 +246,7 @@ public class MultiReleaseJarTests extends AbstractBundleTests {
"Manifest-Version: 1\n" + //
"Multi-Release: true\n\n";
bundleEntries.put("classPathDir/META-INF/", null);
- bundleEntries.put("classPathDir/META-INF/MANIFEST.MF", classPathDirManifest.getBytes(Charset.forName("UTF-8")));
+ bundleEntries.put("classPathDir/META-INF/MANIFEST.MF", classPathDirManifest.getBytes(StandardCharsets.UTF_8));
bundleEntries.put("classPathDir/META-INF/versions/", null);
bundleEntries.put("classPathDir/META-INF/versions/8/", null);
bundleEntries.put("classPathDir/META-INF/versions/8/multi/", null);
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/TestModuleContainer.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/TestModuleContainer.java
index 3e83af0f1..46e89750f 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/TestModuleContainer.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/TestModuleContainer.java
@@ -26,6 +26,7 @@ import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.PrintStream;
+import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -2193,7 +2194,7 @@ public class TestModuleContainer extends AbstractTest {
DummyContainerAdaptor adaptor = createDummyAdaptor();
ModuleContainer container = adaptor.getContainer();
String utfString = "a.with.�.multibyte";
- while (utfString.getBytes("UTF8").length < 500) {
+ while (utfString.getBytes(StandardCharsets.UTF_8).length < 500) {
Map<String, String> manifest = getUTFManifest(utfString);
Module testModule = installDummyModule(manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME), container);
Assert.assertEquals("Wrong bns for the bundle.", utfString, testModule.getCurrentRevision().getSymbolicName());
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/debugoptions/DebugOptionsTestCase.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/debugoptions/DebugOptionsTestCase.java
index a6c993076..32ce68e01 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/debugoptions/DebugOptionsTestCase.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/debugoptions/DebugOptionsTestCase.java
@@ -14,10 +14,26 @@
package org.eclipse.osgi.tests.debugoptions;
-import java.io.*;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.FilterOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.io.Reader;
+import java.nio.charset.StandardCharsets;
import java.text.ParseException;
import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Dictionary;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.atomic.AtomicReference;
import junit.framework.Test;
@@ -25,7 +41,9 @@ import junit.framework.TestSuite;
import org.eclipse.core.tests.harness.CoreTest;
import org.eclipse.osgi.internal.debug.FrameworkDebugOptions;
import org.eclipse.osgi.internal.debug.FrameworkDebugTraceEntry;
-import org.eclipse.osgi.service.debug.*;
+import org.eclipse.osgi.service.debug.DebugOptions;
+import org.eclipse.osgi.service.debug.DebugOptionsListener;
+import org.eclipse.osgi.service.debug.DebugTrace;
import org.eclipse.osgi.tests.OSGiTestsActivator;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
@@ -236,7 +254,7 @@ public class DebugOptionsTestCase extends CoreTest {
String key1 = getName() + "/debug/disableCheck1";
String key2 = getName() + "/debug/disableCheck2";
String key3 = getName() + "/debug/disableCheck3";
- Map /* <String, String> */newOptions = new HashMap();
+ Map /* <String, String> */ newOptions = new HashMap();
newOptions.put(key1, "ok1");
newOptions.put(key2, "ok2");
newOptions.put(key3, "ok3");
@@ -247,7 +265,7 @@ public class DebugOptionsTestCase extends CoreTest {
// make sure the listener got called
assertTrue("Listener did not get called when setting batch options when tracing is enabled", listener.gotCalled()); //$NON-NLS-1$
// get all of the options
- Map/* <String, String> */currentOptions = debugOptions.getOptions();
+ Map/* <String, String> */ currentOptions = debugOptions.getOptions();
// make sure the Map object returned is not the same Map object that was set
assertNotSame("The Map object set is the exact same Map object returned", newOptions, currentOptions);
// make sure the size is correct (it should be the same as the original Map)
@@ -263,7 +281,7 @@ public class DebugOptionsTestCase extends CoreTest {
String key4 = getName() + "/debug/disableCheck4";
String key5 = getName() + "/debug/disableCheck5";
String key6 = getName() + "/debug/disableCheck6";
- Map /* <String, String> */newOptions2 = new HashMap();
+ Map /* <String, String> */ newOptions2 = new HashMap();
newOptions2.put(key4, "ok4");
newOptions2.put(key5, "ok5");
newOptions2.put(key6, "ok6");
@@ -330,7 +348,7 @@ public class DebugOptionsTestCase extends CoreTest {
String key1 = getName() + "/debug/disableCheck1";
String key2 = getName() + "/debug/disableCheck2";
String key3 = getName() + "/debug/disableCheck3";
- Map /* <String, String> */newOptions = new HashMap();
+ Map /* <String, String> */ newOptions = new HashMap();
newOptions.put(key1, "ok1");
newOptions.put(key2, "ok2");
newOptions.put(key3, "ok3");
@@ -363,7 +381,7 @@ public class DebugOptionsTestCase extends CoreTest {
String key4 = getName() + "/debug/disableCheck4";
String key5 = getName() + "/debug/disableCheck5";
String key6 = getName() + "/debug/disableCheck6";
- Map /* <String, String> */newOptions2 = new HashMap();
+ Map /* <String, String> */ newOptions2 = new HashMap();
newOptions2.put(key4, "ok4");
newOptions2.put(key5, "ok5");
newOptions2.put(key6, "ok6");
@@ -1027,7 +1045,7 @@ public class DebugOptionsTestCase extends CoreTest {
List traceEntries = new ArrayList();
this.verboseDebug = true; // default is true
try {
- traceReader = new BufferedReader(new InputStreamReader(new FileInputStream(traceFile), "UTF-8")); //$NON-NLS-1$
+ traceReader = new BufferedReader(new InputStreamReader(new FileInputStream(traceFile), StandardCharsets.UTF_8));
TraceEntry entry = null;
while ((entry = this.readMessage(traceReader)) != null) {
traceEntries.add(entry);

Back to the top