diff options
author | Lars Vogel | 2019-02-08 08:09:05 +0000 |
---|---|---|
committer | Lars Vogel | 2019-02-08 13:10:15 +0000 |
commit | 5bf1d62abd7f8c18a5c1e327b94ad367a72c98e3 (patch) | |
tree | 3bf22ae416b67cf1fd8917b125b9bc4ea964420c | |
parent | d3394e13eef56d255d0a1852a92f432c31e4f6ec (diff) | |
download | rt.equinox.framework-5bf1d62abd7f8c18a5c1e327b94ad367a72c98e3.tar.gz rt.equinox.framework-5bf1d62abd7f8c18a5c1e327b94ad367a72c98e3.tar.xz rt.equinox.framework-5bf1d62abd7f8c18a5c1e327b94ad367a72c98e3.zip |
Avoid using deprecated new Integer in org.eclipse.osgi.tests
Change-Id: I0a59f3b1700480852360c62b8cea8b510b30ea03
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
6 files changed, 24 insertions, 24 deletions
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/appadmin/ApplicationAdminTest.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/appadmin/ApplicationAdminTest.java index c194597cb..25ea6c6ab 100644 --- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/appadmin/ApplicationAdminTest.java +++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/appadmin/ApplicationAdminTest.java @@ -145,7 +145,7 @@ public class ApplicationAdminTest extends OSGiTest { ApplicationDescriptor app = getApplication(PI_OSGI_TESTS + ".simpleApp"); //$NON-NLS-1$ HashMap args = new HashMap(); args.put("test.arg1", Boolean.TRUE); //$NON-NLS-1$ - args.put("test.arg2", new Integer(34)); //$NON-NLS-1$ + args.put("test.arg2", Integer.valueOf(34)); //$NON-NLS-1$ args.put("test.arg3", new Long(34)); //$NON-NLS-1$ doInvalidScheduleArgs(app, "schedule.testargs", args, "org/osgi/application/timer", "(minute=*)", true, false, false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ @@ -162,7 +162,7 @@ public class ApplicationAdminTest extends OSGiTest { list.clear(); list.add("test"); //$NON-NLS-1$ - list.add(new Integer(0)); + list.add(Integer.valueOf(0)); list.add(new Long(0)); list.add(new Float(0)); list.add(new Double(0)); @@ -184,7 +184,7 @@ public class ApplicationAdminTest extends OSGiTest { doInvalidScheduleArgs(app, "schedule.testargs", args, "org/osgi/application/timer", "(minute=*)", true, false, false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ args.put("test.arg13", "test"); //$NON-NLS-1$ //$NON-NLS-2$ - args.put("test.arg14", new Integer(0)); //$NON-NLS-1$ + args.put("test.arg14", Integer.valueOf(0)); //$NON-NLS-1$ args.put("test.arg15", new Long(0)); //$NON-NLS-1$ args.put("test.arg16", new Float(0)); //$NON-NLS-1$ args.put("test.arg17", new Double(0)); //$NON-NLS-1$ @@ -823,7 +823,7 @@ public class ApplicationAdminTest extends OSGiTest { try { HashMap args = new HashMap(); args.put("test.arg1", Boolean.TRUE); //$NON-NLS-1$ - args.put("test.arg2", new Integer(34)); //$NON-NLS-1$ + args.put("test.arg2", Integer.valueOf(34)); //$NON-NLS-1$ args.put("test.arg3", new Long(34)); //$NON-NLS-1$ app.schedule("schedule.1", args, "org/osgi/application/timer", "(minute=*)", true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } catch (InvalidSyntaxException e) { @@ -853,7 +853,7 @@ public class ApplicationAdminTest extends OSGiTest { assertNotNull("Null results", results); //$NON-NLS-1$ HashMap args = new HashMap(); args.put("test.arg1", Boolean.TRUE); //$NON-NLS-1$ - args.put("test.arg2", new Integer(34)); //$NON-NLS-1$ + args.put("test.arg2", Integer.valueOf(34)); //$NON-NLS-1$ args.put("test.arg3", new Long(34)); //$NON-NLS-1$ for (Iterator iEntries = args.entrySet().iterator(); iEntries.hasNext();) { Map.Entry entry = (Map.Entry) iEntries.next(); @@ -882,7 +882,7 @@ public class ApplicationAdminTest extends OSGiTest { app.lock(); HashMap args = new HashMap(); args.put("test.arg1", Boolean.TRUE); //$NON-NLS-1$ - args.put("test.arg2", new Integer(34)); //$NON-NLS-1$ + args.put("test.arg2", Integer.valueOf(34)); //$NON-NLS-1$ args.put("test.arg3", new Long(34)); //$NON-NLS-1$ // make it non-recurring app.schedule("schedule.2", args, "org/osgi/application/timer", "(minute=*)", false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ @@ -918,7 +918,7 @@ public class ApplicationAdminTest extends OSGiTest { assertNotNull("Null results", results); //$NON-NLS-1$ HashMap args = new HashMap(); args.put("test.arg1", Boolean.TRUE); //$NON-NLS-1$ - args.put("test.arg2", new Integer(34)); //$NON-NLS-1$ + args.put("test.arg2", Integer.valueOf(34)); //$NON-NLS-1$ args.put("test.arg3", new Long(34)); //$NON-NLS-1$ for (Iterator iEntries = args.entrySet().iterator(); iEntries.hasNext();) { Map.Entry entry = (Map.Entry) iEntries.next(); diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/filter/FilterTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/filter/FilterTests.java index ae2fe8474..d005bde8f 100644 --- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/filter/FilterTests.java +++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/filter/FilterTests.java @@ -50,7 +50,7 @@ public abstract class FilterTests extends TestCase { private Dictionary getProperties() { Dictionary props = new Hashtable(); props.put("room", "bedroom"); - props.put("channel", new Object[] {new Integer(34), "101"}); + props.put("channel", new Object[] {Integer.valueOf(34), "101"}); props.put("status", "(on\\)*"); List vec = new ArrayList(10); vec.add(new Long(150)); @@ -58,7 +58,7 @@ public abstract class FilterTests extends TestCase { props.put("max record time", vec); props.put("canrecord", "true(x)"); props.put("shortvalue", new Short((short) 1000)); - props.put("intvalue", new Integer(100000)); + props.put("intvalue", Integer.valueOf(100000)); props.put("longvalue", new Long(10000000000L)); props.put("bytevalue", new Byte((byte) 10)); props.put("floatvalue", new Float(1.01)); diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/security/BaseSecurityTest.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/security/BaseSecurityTest.java index ea31f35ec..789c86290 100644 --- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/security/BaseSecurityTest.java +++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/security/BaseSecurityTest.java @@ -87,7 +87,7 @@ public class BaseSecurityTest extends CoreTest { KeyStoreTrustEngine dummyTE = new KeyStoreTrustEngine(tempEngine.getAbsolutePath(), "JKS", "changeit".toCharArray(), "temp.jks", null); Hashtable properties = new Hashtable(7); - properties.put(Constants.SERVICE_RANKING, new Integer(Integer.MAX_VALUE)); + properties.put(Constants.SERVICE_RANKING, Integer.valueOf(Integer.MAX_VALUE)); trustReg = OSGiTestsActivator.getContext().registerService(TrustEngine.class.getName(), dummyTE, properties); } diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/serviceregistry/ServiceHookTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/serviceregistry/ServiceHookTests.java index 81b988464..a263d07e7 100644 --- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/serviceregistry/ServiceHookTests.java +++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/serviceregistry/ServiceHookTests.java @@ -53,7 +53,7 @@ public class ServiceHookTests extends AbstractBundleTests { // register find hook 1 props.put(Constants.SERVICE_DESCRIPTION, "find hook 1"); //$NON-NLS-1$ props.put(Constants.SERVICE_DESCRIPTION, "min value"); //$NON-NLS-1$ - props.put(Constants.SERVICE_RANKING, new Integer(Integer.MIN_VALUE)); + props.put(Constants.SERVICE_RANKING, Integer.valueOf(Integer.MIN_VALUE)); ServiceRegistration regHook1 = testContext.registerService(FindHook.class.getName(), new FindHook() { public void find(BundleContext context, String name, String filter, boolean allServices, Collection references) { try { @@ -104,7 +104,7 @@ public class ServiceHookTests extends AbstractBundleTests { // register find hook 2 props.put(Constants.SERVICE_DESCRIPTION, "find hook 2"); //$NON-NLS-1$ props.put(Constants.SERVICE_DESCRIPTION, "max value first"); //$NON-NLS-1$ - props.put(Constants.SERVICE_RANKING, new Integer(Integer.MAX_VALUE)); + props.put(Constants.SERVICE_RANKING, Integer.valueOf(Integer.MAX_VALUE)); ServiceRegistration regHook2 = testContext.registerService(FindHook.class.getName(), new FindHook() { public void find(BundleContext context, String name, String filter, boolean allServices, Collection references) { try { @@ -152,7 +152,7 @@ public class ServiceHookTests extends AbstractBundleTests { // register find hook 3 props.put(Constants.SERVICE_DESCRIPTION, "find hook 3"); //$NON-NLS-1$ props.put(Constants.SERVICE_DESCRIPTION, "max value second"); //$NON-NLS-1$ - props.put(Constants.SERVICE_RANKING, new Integer(Integer.MAX_VALUE)); + props.put(Constants.SERVICE_RANKING, Integer.valueOf(Integer.MAX_VALUE)); ServiceRegistration regHook3 = testContext.registerService(FindHook.class.getName(), new FindHook() { public void find(BundleContext context, String name, String filter, boolean allServices, Collection references) { try { @@ -202,7 +202,7 @@ public class ServiceHookTests extends AbstractBundleTests { // register find hook 4 props.put(Constants.SERVICE_DESCRIPTION, "find hook 4"); //$NON-NLS-1$ props.put(Constants.SERVICE_DESCRIPTION, "max value third"); //$NON-NLS-1$ - props.put(Constants.SERVICE_RANKING, new Integer(Integer.MAX_VALUE)); + props.put(Constants.SERVICE_RANKING, Integer.valueOf(Integer.MAX_VALUE)); ServiceRegistration regHook4 = testContext.registerService(FindHook.class.getName(), new FindHook() { public void find(BundleContext context, String name, String filter, boolean allServices, Collection references) { try { diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/serviceregistry/ServiceRegistryTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/serviceregistry/ServiceRegistryTests.java index cae7f634a..ff7dae6eb 100644 --- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/serviceregistry/ServiceRegistryTests.java +++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/serviceregistry/ServiceRegistryTests.java @@ -365,15 +365,15 @@ public class ServiceRegistryTests extends AbstractBundleTests { Hashtable props = new Hashtable(); props.put("name", testMethodName); //$NON-NLS-1$ props.put(Constants.SERVICE_DESCRIPTION, "min value"); //$NON-NLS-1$ - props.put(Constants.SERVICE_RANKING, new Integer(Integer.MIN_VALUE)); + props.put(Constants.SERVICE_RANKING, Integer.valueOf(Integer.MIN_VALUE)); ServiceRegistration reg1 = OSGiTestsActivator.getContext().registerService(Runnable.class.getName(), runIt, props); props.put(Constants.SERVICE_DESCRIPTION, "max value first"); //$NON-NLS-1$ - props.put(Constants.SERVICE_RANKING, new Integer(Integer.MAX_VALUE)); + props.put(Constants.SERVICE_RANKING, Integer.valueOf(Integer.MAX_VALUE)); ServiceRegistration reg2 = OSGiTestsActivator.getContext().registerService(Runnable.class.getName(), runIt, props); props.put(Constants.SERVICE_DESCRIPTION, "max value second"); //$NON-NLS-1$ - props.put(Constants.SERVICE_RANKING, new Integer(Integer.MAX_VALUE)); + props.put(Constants.SERVICE_RANKING, Integer.valueOf(Integer.MAX_VALUE)); ServiceRegistration reg3 = OSGiTestsActivator.getContext().registerService(Runnable.class.getName(), runIt, props); try { @@ -418,15 +418,15 @@ public class ServiceRegistryTests extends AbstractBundleTests { Hashtable props = new Hashtable(); props.put("name", testMethodName); //$NON-NLS-1$ props.put(Constants.SERVICE_DESCRIPTION, "min value"); //$NON-NLS-1$ - props.put(Constants.SERVICE_RANKING, new Integer(Integer.MIN_VALUE)); + props.put(Constants.SERVICE_RANKING, Integer.valueOf(Integer.MIN_VALUE)); ServiceRegistration reg1 = OSGiTestsActivator.getContext().registerService(Runnable.class.getName(), runIt, props); props.put(Constants.SERVICE_DESCRIPTION, "max value first"); //$NON-NLS-1$ - props.put(Constants.SERVICE_RANKING, new Integer(Integer.MAX_VALUE)); + props.put(Constants.SERVICE_RANKING, Integer.valueOf(Integer.MAX_VALUE)); ServiceRegistration reg2 = OSGiTestsActivator.getContext().registerService(Runnable.class.getName(), runIt, props); props.put(Constants.SERVICE_DESCRIPTION, "max value second"); //$NON-NLS-1$ - props.put(Constants.SERVICE_RANKING, new Integer(Integer.MAX_VALUE)); + props.put(Constants.SERVICE_RANKING, Integer.valueOf(Integer.MAX_VALUE)); ServiceRegistration reg3 = OSGiTestsActivator.getContext().registerService(Runnable.class.getName(), runIt, props); try { @@ -470,14 +470,14 @@ public class ServiceRegistryTests extends AbstractBundleTests { }; Hashtable props = new Hashtable(); props.put(getName(), Boolean.TRUE); - props.put(Constants.SERVICE_RANKING, new Integer(15)); + props.put(Constants.SERVICE_RANKING, Integer.valueOf(15)); ServiceRegistration reg1 = getContext().registerService(Runnable.class.getName(), runIt, props); - props.put(Constants.SERVICE_RANKING, new Integer(10)); + props.put(Constants.SERVICE_RANKING, Integer.valueOf(10)); ServiceRegistration reg2 = getContext().registerService(Runnable.class.getName(), runIt, props); try { assertEquals("wrong service reference", reg1.getReference(), getContext().getServiceReference("java.lang.Runnable")); //$NON-NLS-1$//$NON-NLS-2$ - props.put(Constants.SERVICE_RANKING, new Integer(20)); + props.put(Constants.SERVICE_RANKING, Integer.valueOf(20)); reg2.setProperties(props); assertEquals("wrong service reference", reg2.getReference(), getContext().getServiceReference("java.lang.Runnable")); //$NON-NLS-1$//$NON-NLS-2$ } finally { diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/util/NLSTestCase.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/util/NLSTestCase.java index 2f97cfccb..5878e8e93 100644 --- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/util/NLSTestCase.java +++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/util/NLSTestCase.java @@ -21,7 +21,7 @@ public class NLSTestCase extends CoreTest { public void testEmptyMessageBug200296() { try { - NLS.bind("", new Integer(0)); + NLS.bind("", Integer.valueOf(0)); } catch (NegativeArraySizeException e) { fail("1.0", e); } |