Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2019-02-08 09:31:07 +0000
committerLars Vogel2019-04-23 08:28:16 +0000
commitcff5a7b2f0bc4d5ee457556c416bee04fc3ae550 (patch)
tree36cac30780a6584f21572c4559415bc32991b7b5
parentf4655f59fe493804e8414531b53ae9a193ec1be9 (diff)
downloadrt.equinox.framework-cff5a7b2f0bc4d5ee457556c416bee04fc3ae550.tar.gz
rt.equinox.framework-cff5a7b2f0bc4d5ee457556c416bee04fc3ae550.tar.xz
rt.equinox.framework-cff5a7b2f0bc4d5ee457556c416bee04fc3ae550.zip
Remove usage of deprecated constructors and replace StringBuffer with
StringBuilder Change-Id: I2c11ad3301c7f5a7c1397804c45b0c9004d75fbd Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r--bundles/org.eclipse.osgi.tests/bundles_src/test.link.a/test/link/a/SomeAPI.java2
-rw-r--r--bundles/org.eclipse.osgi.tests/bundles_src/thread.locktest/thread/locktest/Activator.java2
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/appadmin/ApplicationAdminTest.java40
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/AbstractBundleTests.java4
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ClassLoadingBundleTests.java4
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/debugoptions/DebugOptionsTestCase.java16
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/filter/FilterTests.java35
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/hooks/framework/BundleFileWrapperFactoryHookTests.java2
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/datalocation/FileManagerTests.java2
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/datalocation/StreamManagerTests.java2
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/GenericCapabilityTest.java36
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/OSGiCapabilityTest.java2
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/StateResolverTest.java56
13 files changed, 107 insertions, 96 deletions
diff --git a/bundles/org.eclipse.osgi.tests/bundles_src/test.link.a/test/link/a/SomeAPI.java b/bundles/org.eclipse.osgi.tests/bundles_src/test.link.a/test/link/a/SomeAPI.java
index 9a6e6714f..b8e66fcc2 100644
--- a/bundles/org.eclipse.osgi.tests/bundles_src/test.link.a/test/link/a/SomeAPI.java
+++ b/bundles/org.eclipse.osgi.tests/bundles_src/test.link.a/test/link/a/SomeAPI.java
@@ -18,7 +18,7 @@ import test.link.a.params.AParam;
public class SomeAPI {
public Long getBundleID(Bundle bundle) {
- return new Long(bundle.getBundleId());
+ return Long.valueOf(bundle.getBundleId());
}
public String getString(AParam arg0) {
diff --git a/bundles/org.eclipse.osgi.tests/bundles_src/thread.locktest/thread/locktest/Activator.java b/bundles/org.eclipse.osgi.tests/bundles_src/thread.locktest/thread/locktest/Activator.java
index 6970f0e93..b3006ff10 100644
--- a/bundles/org.eclipse.osgi.tests/bundles_src/thread.locktest/thread/locktest/Activator.java
+++ b/bundles/org.eclipse.osgi.tests/bundles_src/thread.locktest/thread/locktest/Activator.java
@@ -41,7 +41,7 @@ public class Activator implements BundleActivator, Runnable {
long totalTime = System.currentTimeMillis() - startTime;
System.out.println("loaded Class1 " + totalTime);
if (totalTime < 40000)
- AbstractBundleTests.simpleResults.addEvent(new Long(5000));
+ AbstractBundleTests.simpleResults.addEvent(Long.valueOf(5000));
}
}
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 25ea6c6ab..2023936ea 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
@@ -146,7 +146,7 @@ public class ApplicationAdminTest extends OSGiTest {
HashMap args = new HashMap();
args.put("test.arg1", Boolean.TRUE); //$NON-NLS-1$
args.put("test.arg2", Integer.valueOf(34)); //$NON-NLS-1$
- args.put("test.arg3", new Long(34)); //$NON-NLS-1$
+ args.put("test.arg3", Long.valueOf(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$
args.put("test.arg4", this); //$NON-NLS-1$
@@ -163,12 +163,12 @@ public class ApplicationAdminTest extends OSGiTest {
list.clear();
list.add("test"); //$NON-NLS-1$
list.add(Integer.valueOf(0));
- list.add(new Long(0));
- list.add(new Float(0));
- list.add(new Double(0));
- list.add(new Byte((byte) 0));
- list.add(new Short((short) 1));
- list.add(new Character((char) 0));
+ list.add(Long.valueOf(0));
+ list.add(Float.valueOf(0));
+ list.add(Double.valueOf(0));
+ list.add(Byte.valueOf((byte) 0));
+ list.add(Short.valueOf((short) 1));
+ list.add(Character.valueOf((char) 0));
list.add(Boolean.TRUE);
doInvalidScheduleArgs(app, "schedule.testargs", args, "org/osgi/application/timer", "(minute=*)", true, false, false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -185,12 +185,12 @@ public class ApplicationAdminTest extends OSGiTest {
args.put("test.arg13", "test"); //$NON-NLS-1$ //$NON-NLS-2$
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$
- args.put("test.arg18", new Byte((byte) 0)); //$NON-NLS-1$
- args.put("test.arg19", new Short((short) 1)); //$NON-NLS-1$
- args.put("test.arg20", new Character((char) 0)); //$NON-NLS-1$
+ args.put("test.arg15", Long.valueOf(0)); //$NON-NLS-1$
+ args.put("test.arg16", Float.valueOf(0)); //$NON-NLS-1$
+ args.put("test.arg17", Double.valueOf(0)); //$NON-NLS-1$
+ args.put("test.arg18", Byte.valueOf((byte) 0)); //$NON-NLS-1$
+ args.put("test.arg19", Short.valueOf((short) 1)); //$NON-NLS-1$
+ args.put("test.arg20", Character.valueOf((char) 0)); //$NON-NLS-1$
args.put("test.arg21", Boolean.TRUE); //$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$
@@ -199,7 +199,7 @@ public class ApplicationAdminTest extends OSGiTest {
doInvalidScheduleArgs(app, "schedule.testargs", args, "org/osgi/application/timer", "(minute=*)", true, false, true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
args.clear();
- args.put(new Long(0), "test"); //$NON-NLS-1$
+ args.put(Long.valueOf(0), "test"); //$NON-NLS-1$
doInvalidScheduleArgs(app, "schedule.testargs", args, "org/osgi/application/timer", "(minute=*)", true, true, false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
@@ -824,7 +824,7 @@ public class ApplicationAdminTest extends OSGiTest {
HashMap args = new HashMap();
args.put("test.arg1", Boolean.TRUE); //$NON-NLS-1$
args.put("test.arg2", Integer.valueOf(34)); //$NON-NLS-1$
- args.put("test.arg3", new Long(34)); //$NON-NLS-1$
+ args.put("test.arg3", Long.valueOf(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) {
fail("Failed to schedule an application", e); //$NON-NLS-1$
@@ -854,7 +854,7 @@ public class ApplicationAdminTest extends OSGiTest {
HashMap args = new HashMap();
args.put("test.arg1", Boolean.TRUE); //$NON-NLS-1$
args.put("test.arg2", Integer.valueOf(34)); //$NON-NLS-1$
- args.put("test.arg3", new Long(34)); //$NON-NLS-1$
+ args.put("test.arg3", Long.valueOf(34)); //$NON-NLS-1$
for (Iterator iEntries = args.entrySet().iterator(); iEntries.hasNext();) {
Map.Entry entry = (Map.Entry) iEntries.next();
assertEquals("key: " + entry.getKey(), entry.getValue(), results.get(entry.getKey())); //$NON-NLS-1$
@@ -883,7 +883,7 @@ public class ApplicationAdminTest extends OSGiTest {
HashMap args = new HashMap();
args.put("test.arg1", Boolean.TRUE); //$NON-NLS-1$
args.put("test.arg2", Integer.valueOf(34)); //$NON-NLS-1$
- args.put("test.arg3", new Long(34)); //$NON-NLS-1$
+ args.put("test.arg3", Long.valueOf(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$
} catch (InvalidSyntaxException e) {
@@ -919,7 +919,7 @@ public class ApplicationAdminTest extends OSGiTest {
HashMap args = new HashMap();
args.put("test.arg1", Boolean.TRUE); //$NON-NLS-1$
args.put("test.arg2", Integer.valueOf(34)); //$NON-NLS-1$
- args.put("test.arg3", new Long(34)); //$NON-NLS-1$
+ args.put("test.arg3", Long.valueOf(34)); //$NON-NLS-1$
for (Iterator iEntries = args.entrySet().iterator(); iEntries.hasNext();) {
Map.Entry entry = (Map.Entry) iEntries.next();
assertEquals("key: " + entry.getKey(), entry.getValue(), results.get(entry.getKey())); //$NON-NLS-1$
@@ -1160,7 +1160,7 @@ public class ApplicationAdminTest extends OSGiTest {
Object[][] foundEvents = getEvents();
String foundEventsMsg;
if (foundEvents.length > 0) {
- StringBuffer eventsBuffer = new StringBuffer();
+ StringBuilder eventsBuffer = new StringBuilder();
eventsBuffer.append("\nFound the following events: \n"); //$NON-NLS-1$
for (int i = 0; i < foundEvents.length; i++)
eventsBuffer.append(" handle event: ").append(foundEvents[i][0]).append(" ").append(foundEvents[i][1]).append("\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -1239,7 +1239,7 @@ public class ApplicationAdminTest extends OSGiTest {
Object[][] foundEvents = getEvents();
String foundEventsMsg;
if (foundEvents.length > 0) {
- StringBuffer eventsBuffer = new StringBuffer();
+ StringBuilder eventsBuffer = new StringBuilder();
eventsBuffer.append("\nFound the following events: \n"); //$NON-NLS-1$
for (int i = 0; i < foundEvents.length; i++)
eventsBuffer.append(" descriptor event: ").append(foundEvents[i][0]).append(" ").append(foundEvents[i][1]).append(" ").append(foundEvents[i][2]).append(" ").append(foundEvents[i][3]).append("\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/AbstractBundleTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/AbstractBundleTests.java
index 3dac26cc4..fc5a0a2eb 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/AbstractBundleTests.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/AbstractBundleTests.java
@@ -143,7 +143,7 @@ public class AbstractBundleTests extends CoreTest {
}
private static Object toString(FrameworkEvent event) {
- StringBuffer result = new StringBuffer("FrameworkEvent [");
+ StringBuilder result = new StringBuilder("FrameworkEvent [");
switch (event.getType()) {
case FrameworkEvent.ERROR :
result.append("ERROR");
@@ -171,7 +171,7 @@ public class AbstractBundleTests extends CoreTest {
}
private static Object toString(BundleEvent event) {
- StringBuffer result = new StringBuffer("BundleEvent [");
+ StringBuilder result = new StringBuilder("BundleEvent [");
switch (event.getType()) {
case BundleEvent.INSTALLED :
result.append("INSTALLED");
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ClassLoadingBundleTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ClassLoadingBundleTests.java
index 0246e2619..586237f20 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ClassLoadingBundleTests.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ClassLoadingBundleTests.java
@@ -1013,7 +1013,7 @@ public class ClassLoadingBundleTests extends AbstractBundleTests {
threadLockTest.loadClass("thread.locktest.ATest"); //$NON-NLS-1$
Object[] expectedEvents = new Object[2];
- expectedEvents[0] = new Long(5000);
+ expectedEvents[0] = Long.valueOf(5000);
expectedEvents[1] = new BundleEvent(BundleEvent.STARTED, threadLockTest);
Object[] actualEvents = simpleResults.getResults(2);
compareResults(expectedEvents, actualEvents);
@@ -2123,7 +2123,7 @@ public class ClassLoadingBundleTests extends AbstractBundleTests {
}
private String readURL(URL url) {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
try {
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 11931b535..a6c993076 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
@@ -538,13 +538,13 @@ public class DebugOptionsTestCase extends CoreTest {
assertNull("A method name was found when it should be null", traceOutput[0].getMethodName()); //$NON-NLS-1$
assertTrue("A line number other than -1 was read in", traceOutput[0].getLineNumber() == -1); //$NON-NLS-1$
assertEquals("trace message is incorrect", "testing 1", traceOutput[0].getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
- final StringBuffer expectedThrowableText1 = new StringBuffer("java.lang.Exception: "); //$NON-NLS-1$
+ final StringBuilder expectedThrowableText1 = new StringBuilder("java.lang.Exception: "); //$NON-NLS-1$
expectedThrowableText1.append(exceptionMessage1);
expectedThrowableText1.append(DebugOptionsTestCase.LINE_SEPARATOR);
expectedThrowableText1.append(DebugOptionsTestCase.TAB_CHARACTER);
expectedThrowableText1.append("at org.eclipse.osgi.tests.debugoptions.DebugOptionsTestCase.testVerboseDebugging(DebugOptionsTestCase.java:"); //$NON-NLS-1$
if (!traceOutput[0].getThrowableText().startsWith(expectedThrowableText1.toString())) {
- final StringBuffer errorMessage = new StringBuffer("The expected throwable text does not start with the actual throwable text."); //$NON-NLS-1$
+ final StringBuilder errorMessage = new StringBuilder("The expected throwable text does not start with the actual throwable text."); //$NON-NLS-1$
errorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);
errorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);
errorMessage.append("Expected"); //$NON-NLS-1$
@@ -649,7 +649,7 @@ public class DebugOptionsTestCase extends CoreTest {
fail("Failed 'DebugTrace.trace(option, message, Throwable)' test as an invalid trace entry was found. Actual Value: '" + invalidEx.getActualValue() + "'.", invalidEx); //$NON-NLS-1$ //$NON-NLS-2$
}
- final StringBuffer expectedThrowableText1 = new StringBuffer("java.lang.Exception: "); //$NON-NLS-1$
+ final StringBuilder expectedThrowableText1 = new StringBuilder("java.lang.Exception: "); //$NON-NLS-1$
expectedThrowableText1.append(exceptionMessage1);
expectedThrowableText1.append(DebugOptionsTestCase.LINE_SEPARATOR);
expectedThrowableText1.append(DebugOptionsTestCase.TAB_CHARACTER);
@@ -664,7 +664,7 @@ public class DebugOptionsTestCase extends CoreTest {
assertEquals("trace message is incorrect", "testing 1", traceOutput[0].getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
assertNotNull("throwable text should not be null", traceOutput[0].getThrowableText()); //$NON-NLS-1$
if (!traceOutput[0].getThrowableText().startsWith(expectedThrowableText1.toString())) {
- final StringBuffer errorMessage = new StringBuffer("The expected throwable text does not start with the actual throwable text."); //$NON-NLS-1$
+ final StringBuilder errorMessage = new StringBuilder("The expected throwable text does not start with the actual throwable text."); //$NON-NLS-1$
errorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);
errorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);
errorMessage.append("Expected"); //$NON-NLS-1$
@@ -684,7 +684,7 @@ public class DebugOptionsTestCase extends CoreTest {
assertNotNull("throwable should not be null", traceOutput[0].getThrowableText()); //$NON-NLS-1$
assertEquals("Wrong number of trace entries for trace without an exception", 2, traceOutput.length); //$NON-NLS-1$
- final StringBuffer expectedThrowableText2 = new StringBuffer("java.lang.Exception: "); //$NON-NLS-1$
+ final StringBuilder expectedThrowableText2 = new StringBuilder("java.lang.Exception: "); //$NON-NLS-1$
expectedThrowableText2.append(exceptionMessage3);
expectedThrowableText2.append(DebugOptionsTestCase.LINE_SEPARATOR);
expectedThrowableText2.append(DebugOptionsTestCase.TAB_CHARACTER);
@@ -698,7 +698,7 @@ public class DebugOptionsTestCase extends CoreTest {
assertEquals("trace message is incorrect", "testing 3", traceOutput[1].getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
assertNotNull("throwable text should not be null", traceOutput[1].getThrowableText()); //$NON-NLS-1$
if (!traceOutput[1].getThrowableText().startsWith(expectedThrowableText2.toString())) {
- final StringBuffer errorMessage = new StringBuffer("The expected throwable text does not start with the actual throwable text."); //$NON-NLS-1$
+ final StringBuilder errorMessage = new StringBuilder("The expected throwable text does not start with the actual throwable text."); //$NON-NLS-1$
errorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);
errorMessage.append(DebugOptionsTestCase.LINE_SEPARATOR);
errorMessage.append("Expected"); //$NON-NLS-1$
@@ -1012,7 +1012,7 @@ public class DebugOptionsTestCase extends CoreTest {
private static String decodeString(final String inputString) {
if (inputString == null || inputString.indexOf(TRACE_ELEMENT_DELIMITER_ENCODED) < 0)
return inputString;
- final StringBuffer tempBuffer = new StringBuffer(inputString);
+ final StringBuilder tempBuffer = new StringBuilder(inputString);
int currentIndex = tempBuffer.indexOf(TRACE_ELEMENT_DELIMITER_ENCODED);
while (currentIndex >= 0) {
tempBuffer.replace(currentIndex, currentIndex + TRACE_ELEMENT_DELIMITER_ENCODED.length(), TRACE_ELEMENT_DELIMITER);
@@ -1140,7 +1140,7 @@ public class DebugOptionsTestCase extends CoreTest {
private String readEntry(final Reader traceReader) throws IOException {
char inputChar = (char) traceReader.read();
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
while (inputChar != DebugOptionsTestCase.TRACE_ELEMENT_DELIMITER.charAt(0)) {
inputChar = (char) traceReader.read();
if (inputChar != DebugOptionsTestCase.TRACE_ELEMENT_DELIMITER.charAt(0)) {
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 d005bde8f..65b8e4d05 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
@@ -15,11 +15,22 @@ package org.eclipse.osgi.tests.filter;
import java.math.BigDecimal;
import java.math.BigInteger;
-import java.util.*;
-import junit.framework.*;
+import java.util.ArrayList;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+import junit.framework.AssertionFailedError;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
import org.eclipse.osgi.framework.util.CaseInsensitiveDictionaryMap;
import org.eclipse.osgi.tests.util.MapDictionary;
-import org.osgi.framework.*;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Filter;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
public abstract class FilterTests extends TestCase {
public static Test suite() {
@@ -31,7 +42,7 @@ public abstract class FilterTests extends TestCase {
/**
* Fail with cause t.
- *
+ *
* @param message Failure message.
* @param t Cause of the failure.
*/
@@ -53,17 +64,17 @@ public abstract class FilterTests extends TestCase {
props.put("channel", new Object[] {Integer.valueOf(34), "101"});
props.put("status", "(on\\)*");
List vec = new ArrayList(10);
- vec.add(new Long(150));
+ vec.add(Long.valueOf(150));
vec.add("100");
props.put("max record time", vec);
props.put("canrecord", "true(x)");
- props.put("shortvalue", new Short((short) 1000));
+ props.put("shortvalue", Short.valueOf((short) 1000));
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));
- props.put("doublevalue", new Double(2.01));
- props.put("charvalue", new Character('A'));
+ props.put("longvalue", Long.valueOf(10000000000L));
+ props.put("bytevalue", Byte.valueOf((byte) 10));
+ props.put("floatvalue", Float.valueOf(1.01f));
+ props.put("doublevalue", Double.valueOf(2.01));
+ props.put("charvalue", Character.valueOf('A'));
props.put("booleanvalue", Boolean.TRUE);
props.put("weirdvalue", new Hashtable());
props.put("primintarrayvalue", new int[] {1, 2, 3});
@@ -84,7 +95,7 @@ public abstract class FilterTests extends TestCase {
props.put("|", "c");
props.put("&", "c");
props.put("empty", "");
- props.put("space", new Character(' '));
+ props.put("space", Character.valueOf(' '));
return props;
}
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/hooks/framework/BundleFileWrapperFactoryHookTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/hooks/framework/BundleFileWrapperFactoryHookTests.java
index 6a08d013b..77479c781 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/hooks/framework/BundleFileWrapperFactoryHookTests.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/hooks/framework/BundleFileWrapperFactoryHookTests.java
@@ -68,7 +68,7 @@ public class BundleFileWrapperFactoryHookTests extends AbstractFrameworkHookTest
}
private String readURL(URL url) {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
try {
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/datalocation/FileManagerTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/datalocation/FileManagerTests.java
index 1b4109add..d6e67430d 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/datalocation/FileManagerTests.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/datalocation/FileManagerTests.java
@@ -135,7 +135,7 @@ public class FileManagerTests extends OSGiTest {
}
private String getInputStreamContents(InputStream is) throws IOException {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
byte[] data = new byte[64];
int len;
try {
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/datalocation/StreamManagerTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/datalocation/StreamManagerTests.java
index ce92e2250..615b79ff8 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/datalocation/StreamManagerTests.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/datalocation/StreamManagerTests.java
@@ -72,7 +72,7 @@ public class StreamManagerTests extends OSGiTest {
}
private String getInputStreamContents(InputStream is) throws IOException {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
byte[] data = new byte[64];
int len;
try {
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/GenericCapabilityTest.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/GenericCapabilityTest.java
index 985ec0bd7..918450858 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/GenericCapabilityTest.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/GenericCapabilityTest.java
@@ -40,7 +40,7 @@ public class GenericCapabilityTest extends AbstractStateTest {
manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericCapability");
manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- StringBuffer capabililty = new StringBuffer();
+ StringBuilder capabililty = new StringBuilder();
capabililty.append("foo; version=\"1.3.1\"; attr1=\"value1\"; attr2=\"value2\",");
capabililty.append("bar:bartype; version=\"1.4.1\"; attr1=\"value1\"; attr2=\"value2\",");
capabililty.append("test.types:testtype;");
@@ -57,7 +57,7 @@ public class GenericCapabilityTest extends AbstractStateTest {
manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericRequire");
manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- StringBuffer required = new StringBuffer();
+ StringBuilder required = new StringBuilder();
required.append("genericCapability:osgi.identity; selection-filter=\"(version=1.0)\",");
required.append("foo; selection-filter=\"(version>=1.3.0)\",");
required.append("bar:bartype; selection-filter=\"(attr1=value1)\",");
@@ -90,7 +90,7 @@ public class GenericCapabilityTest extends AbstractStateTest {
manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericCapability");
manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- StringBuffer capabililty = new StringBuffer();
+ StringBuilder capabililty = new StringBuilder();
capabililty.append("foo; version=\"1.3.1\"; attr1=\"value1\"; attr2=\"value2\",");
capabililty.append("bar:bartype; version=\"1.4.1\"; attr1=\"value1\"; attr2=\"value2\",");
capabililty.append("test.types:testtype;");
@@ -107,7 +107,7 @@ public class GenericCapabilityTest extends AbstractStateTest {
manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericRequire");
manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- StringBuffer required = new StringBuffer();
+ StringBuilder required = new StringBuilder();
required.append("genericCapability:osgi.identity; selection-filter=\"(version>=1.0)\",");
required.append("foo; selection-filter=\"(version>=1.3.0)\",");
required.append("bar:bartype; selection-filter=\"(attr1=value1)\",");
@@ -136,7 +136,7 @@ public class GenericCapabilityTest extends AbstractStateTest {
manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericCapability");
manifest.put(Constants.BUNDLE_VERSION, "2.0.0");
- capabililty = new StringBuffer();
+ capabililty = new StringBuilder();
capabililty.append("foo; version=\"1.3.2\"; attr1=\"value1\"; attr2=\"value2\",");
capabililty.append("bar:bartype; version=\"1.4.2\"; attr1=\"value1\"; attr2=\"value2\",");
capabililty.append("test.types:testtype;");
@@ -174,7 +174,7 @@ public class GenericCapabilityTest extends AbstractStateTest {
manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericCapability");
manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- StringBuffer capabililty = new StringBuffer();
+ StringBuilder capabililty = new StringBuilder();
capabililty.append("foo; version=\"1.3.1\"; attr1=\"value1\"; attr2=\"value2\",");
capabililty.append("bar:bartype; version=\"1.4.1\"; attr1=\"value1\"; attr2=\"value2\",");
capabililty.append("test.types:testtype;");
@@ -191,7 +191,7 @@ public class GenericCapabilityTest extends AbstractStateTest {
manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericRequire");
manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- StringBuffer required = new StringBuffer();
+ StringBuilder required = new StringBuilder();
required.append("genericCapability:osgi.identity; selection-filter=\"(version>=1.0)\",");
required.append("foo; selection-filter=\"(version>=1.3.0)\",");
required.append("bar:bartype; selection-filter=\"(attr1=value1)\",");
@@ -241,7 +241,7 @@ public class GenericCapabilityTest extends AbstractStateTest {
manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericCapability");
manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- StringBuffer capabililty = new StringBuffer();
+ StringBuilder capabililty = new StringBuilder();
capabililty.append("foo; version=\"1.3.1\"; attr1=\"value1\"; attr2=\"value2\",");
capabililty.append("bar:bartype; version=\"1.4.1\"; attr1=\"value1\"; attr2=\"value2\",");
capabililty.append("test.types:testtype;");
@@ -258,7 +258,7 @@ public class GenericCapabilityTest extends AbstractStateTest {
manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericCapability.frag1");
manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
manifest.put(Constants.FRAGMENT_HOST, "genericCapability;bundle-version=\"[1.0.0,2.0.0)\"");
- capabililty = new StringBuffer();
+ capabililty = new StringBuilder();
capabililty.append("fragmentStuff");
manifest.put(GENERIC_CAPABILITY, capabililty.toString());
BundleDescription genCapFrag = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME), bundleID++);
@@ -267,7 +267,7 @@ public class GenericCapabilityTest extends AbstractStateTest {
manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericRequire");
manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- StringBuffer required = new StringBuffer();
+ StringBuilder required = new StringBuilder();
required.append("genericCapability:osgi.identity; selection-filter=\"(&(version=1.0.0)(type=osgi.bundle))\",");
required.append("foo; selection-filter=\"(version>=1.3.0)\",");
required.append("bar:bartype; selection-filter=\"(attr1=value1)\",");
@@ -328,7 +328,7 @@ public class GenericCapabilityTest extends AbstractStateTest {
manifest.put(Constants.BUNDLE_SYMBOLICNAME, "org.eclipse.equinox.generic.frag.b");
manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
manifest.put(Constants.FRAGMENT_HOST, "org.eclipse.equinox.generic.host;bundle-version=\"1.0.0\"");
- StringBuffer required = new StringBuffer();
+ StringBuilder required = new StringBuilder();
required.append("org.eclipse.equinox.generic.host:osgi.identity; selection-filter=\"(&(version=1.0.0)(type=osgi.bundle))\",");
required.append("frag.a,");
required.append("org.eclipse.equinox.generic.frag.a:osgi.identity; selection-filter=\"(&(version=1.0.0)(type=osgi.fragment))\",");
@@ -412,7 +412,7 @@ public class GenericCapabilityTest extends AbstractStateTest {
manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericCapability");
manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- StringBuffer capabililty = new StringBuffer();
+ StringBuilder capabililty = new StringBuilder();
capabililty.append("foo; version=\"1.3.1\"; attr1=\"value1\"; attr2=\"value2\",");
capabililty.append("bar:bartype; version=\"1.4.1\"; attr1=\"value1\"; attr2=\"value2\",");
capabililty.append("test.types:testtype;");
@@ -432,7 +432,7 @@ public class GenericCapabilityTest extends AbstractStateTest {
manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericRequire");
manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- StringBuffer required = new StringBuffer();
+ StringBuilder required = new StringBuilder();
required.append("genericCapability:osgi.identity; selection-filter=\"(&(version=1.0.0)(type=osgi.bundle))\",");
required.append("foo; selection-filter=\"(version>=1.3.0)\",");
required.append("bar:bartype; selection-filter=\"(attr1=value1)\",");
@@ -477,7 +477,7 @@ public class GenericCapabilityTest extends AbstractStateTest {
manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericCapablity");
manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- StringBuffer capabililty = new StringBuffer();
+ StringBuilder capabililty = new StringBuilder();
capabililty.append("foo; version=\"1.3.1\"; attr1=\"value1\"; attr2=\"value2\",");
capabililty.append("bar:bartype; version=\"1.4.1\"; attr1=\"value1\"; attr2=\"value2\",");
capabililty.append("test.types:testtype;");
@@ -488,7 +488,7 @@ public class GenericCapabilityTest extends AbstractStateTest {
capabililty.append(" aSet:set=\"a,b,c,d\";");
capabililty.append(" aString:string=\"someString\"");
manifest.put(GENERIC_CAPABILITY, capabililty.toString());
- StringBuffer required = new StringBuffer();
+ StringBuilder required = new StringBuilder();
required.append("foo:cycle; selection-filter=\"(version>=1.3.0)\"");
manifest.put(GENERIC_REQUIRE, required.toString());
BundleDescription genCap = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME), bundleID++);
@@ -497,7 +497,7 @@ public class GenericCapabilityTest extends AbstractStateTest {
manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericCapability.frag1");
manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
manifest.put(Constants.FRAGMENT_HOST, "genericCapablity;bundle-version=\"[1.0.0,2.0.0)\"");
- capabililty = new StringBuffer();
+ capabililty = new StringBuilder();
capabililty.append("fragmentStuff");
manifest.put(GENERIC_CAPABILITY, capabililty.toString());
BundleDescription genCapFrag = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME), bundleID++);
@@ -506,10 +506,10 @@ public class GenericCapabilityTest extends AbstractStateTest {
manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericRequire");
manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- capabililty = new StringBuffer();
+ capabililty = new StringBuilder();
capabililty.append("foo:cycle; version:version=\"2.0\"");
manifest.put(GENERIC_CAPABILITY, capabililty.toString());
- required = new StringBuffer();
+ required = new StringBuilder();
required.append("foo; selection-filter=\"(version>=1.3.0)\",");
required.append("bar:bartype; selection-filter=\"(attr1=value1)\",");
required.append("test.types:testtype; selection-filter=\"(&(aVersion>=2.0.0)(aLong>=5555)(aDouble>=1.00)(aUri=file:/test)(aSet=c)(aString=someString))\",");
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/OSGiCapabilityTest.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/OSGiCapabilityTest.java
index a454c853b..3fdaaa75c 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/OSGiCapabilityTest.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/OSGiCapabilityTest.java
@@ -532,7 +532,7 @@ public class OSGiCapabilityTest extends AbstractStateTest {
manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericCapability");
manifest.put(Constants.BUNDLE_VERSION, "1.0.0");
- StringBuffer capabililty = new StringBuffer();
+ StringBuilder capabililty = new StringBuilder();
capabililty.append("testFailure:osgi.identity; test=failure");
manifest.put(GenericCapabilityTest.GENERIC_CAPABILITY, capabililty.toString());
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/StateResolverTest.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/StateResolverTest.java
index b6e537e39..af2b23027 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/StateResolverTest.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/StateResolverTest.java
@@ -119,13 +119,13 @@ public class StateResolverTest extends AbstractStateTest {
assertEquals("1.0", 3, deltas.length); //$NON-NLS-1$
Map deltasMap = new HashMap();
for (int i = 0; i < deltas.length; i++)
- deltasMap.put(new Long(deltas[i].getBundle().getBundleId()), deltas[i]);
- assertNotNull("1.1", deltasMap.get(new Long(1))); //$NON-NLS-1$
- assertNotNull("1.2", deltasMap.get(new Long(2))); //$NON-NLS-1$
- assertNotNull("1.3", deltasMap.get(new Long(3))); //$NON-NLS-1$
- assertEquals("2.1", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(1))).getType()); //$NON-NLS-1$
- assertEquals("2.2", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(2))).getType()); //$NON-NLS-1$
- assertEquals("2.3", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(3))).getType()); //$NON-NLS-1$
+ deltasMap.put(Long.valueOf(deltas[i].getBundle().getBundleId()), deltas[i]);
+ assertNotNull("1.1", deltasMap.get(Long.valueOf(1))); //$NON-NLS-1$
+ assertNotNull("1.2", deltasMap.get(Long.valueOf(2))); //$NON-NLS-1$
+ assertNotNull("1.3", deltasMap.get(Long.valueOf(3))); //$NON-NLS-1$
+ assertEquals("2.1", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(Long.valueOf(1))).getType()); //$NON-NLS-1$
+ assertEquals("2.2", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(Long.valueOf(2))).getType()); //$NON-NLS-1$
+ assertEquals("2.3", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(Long.valueOf(3))).getType()); //$NON-NLS-1$
}
public void testBasicResolution() throws BundleException {
@@ -430,13 +430,13 @@ public class StateResolverTest extends AbstractStateTest {
assertEquals("1.0", 4, deltas.length); //$NON-NLS-1$
Map deltasMap = new HashMap();
for (int i = 0; i < deltas.length; i++)
- deltasMap.put(new Long(deltas[i].getBundle().getBundleId()), deltas[i]);
- assertNotNull("1.1", deltasMap.get(new Long(1))); //$NON-NLS-1$
- assertNotNull("1.2", deltasMap.get(new Long(2))); //$NON-NLS-1$
- assertNotNull("1.3", deltasMap.get(new Long(3))); //$NON-NLS-1$
- assertEquals("2.1", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(1))).getType()); //$NON-NLS-1$
- assertEquals("2.2", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(2))).getType()); //$NON-NLS-1$
- assertEquals("2.3", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(3))).getType()); //$NON-NLS-1$
+ deltasMap.put(Long.valueOf(deltas[i].getBundle().getBundleId()), deltas[i]);
+ assertNotNull("1.1", deltasMap.get(Long.valueOf(1))); //$NON-NLS-1$
+ assertNotNull("1.2", deltasMap.get(Long.valueOf(2))); //$NON-NLS-1$
+ assertNotNull("1.3", deltasMap.get(Long.valueOf(3))); //$NON-NLS-1$
+ assertEquals("2.1", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(Long.valueOf(1))).getType()); //$NON-NLS-1$
+ assertEquals("2.2", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(Long.valueOf(2))).getType()); //$NON-NLS-1$
+ assertEquals("2.3", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(Long.valueOf(3))).getType()); //$NON-NLS-1$
state.removeBundle(1);
delta = state.resolve(false);
deltas = delta.getChanges();
@@ -504,25 +504,25 @@ public class StateResolverTest extends AbstractStateTest {
assertEquals("1.0", 3, deltas.length); //$NON-NLS-1$
Map deltasMap = new HashMap();
for (int i = 0; i < deltas.length; i++)
- deltasMap.put(new Long(deltas[i].getBundle().getBundleId()), deltas[i]);
- assertNotNull("1.1", deltasMap.get(new Long(1))); //$NON-NLS-1$
- assertNotNull("1.2", deltasMap.get(new Long(2))); //$NON-NLS-1$
- assertNotNull("1.3", deltasMap.get(new Long(3))); //$NON-NLS-1$
- assertEquals("2.1", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(1))).getType()); //$NON-NLS-1$
- assertEquals("2.2", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(2))).getType()); //$NON-NLS-1$
- assertEquals("2.3", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(new Long(3))).getType()); //$NON-NLS-1$
+ deltasMap.put(Long.valueOf(deltas[i].getBundle().getBundleId()), deltas[i]);
+ assertNotNull("1.1", deltasMap.get(Long.valueOf(1))); //$NON-NLS-1$
+ assertNotNull("1.2", deltasMap.get(Long.valueOf(2))); //$NON-NLS-1$
+ assertNotNull("1.3", deltasMap.get(Long.valueOf(3))); //$NON-NLS-1$
+ assertEquals("2.1", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(Long.valueOf(1))).getType()); //$NON-NLS-1$
+ assertEquals("2.2", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(Long.valueOf(2))).getType()); //$NON-NLS-1$
+ assertEquals("2.3", (BundleDelta.RESOLVED | BundleDelta.ADDED), ((BundleDelta) deltasMap.get(Long.valueOf(3))).getType()); //$NON-NLS-1$
delta = state.resolve(new BundleDescription[] {state.getBundle(1)});
deltas = delta.getChanges();
assertEquals("3.0", 3, deltas.length); //$NON-NLS-1$
deltasMap = new HashMap();
for (int i = 0; i < deltas.length; i++)
- deltasMap.put(new Long(deltas[i].getBundle().getBundleId()), deltas[i]);
- assertNotNull("3.1", deltasMap.get(new Long(1))); //$NON-NLS-1$
- assertNotNull("3.2", deltasMap.get(new Long(2))); //$NON-NLS-1$
- assertNotNull("3.3", deltasMap.get(new Long(3))); //$NON-NLS-1$
- assertEquals("3.4", BundleDelta.RESOLVED, ((BundleDelta) deltasMap.get(new Long(1))).getType()); //$NON-NLS-1$
- assertEquals("3.5", BundleDelta.RESOLVED, ((BundleDelta) deltasMap.get(new Long(2))).getType()); //$NON-NLS-1$
- assertEquals("3.6", BundleDelta.RESOLVED, ((BundleDelta) deltasMap.get(new Long(3))).getType()); //$NON-NLS-1$
+ deltasMap.put(Long.valueOf(deltas[i].getBundle().getBundleId()), deltas[i]);
+ assertNotNull("3.1", deltasMap.get(Long.valueOf(1))); //$NON-NLS-1$
+ assertNotNull("3.2", deltasMap.get(Long.valueOf(2))); //$NON-NLS-1$
+ assertNotNull("3.3", deltasMap.get(Long.valueOf(3))); //$NON-NLS-1$
+ assertEquals("3.4", BundleDelta.RESOLVED, ((BundleDelta) deltasMap.get(Long.valueOf(1))).getType()); //$NON-NLS-1$
+ assertEquals("3.5", BundleDelta.RESOLVED, ((BundleDelta) deltasMap.get(Long.valueOf(2))).getType()); //$NON-NLS-1$
+ assertEquals("3.6", BundleDelta.RESOLVED, ((BundleDelta) deltasMap.get(Long.valueOf(3))).getType()); //$NON-NLS-1$
}

Back to the top