Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2013-11-19 03:22:45 -0500
committerGerrit Code Review @ Eclipse.org2013-11-19 04:08:59 -0500
commit1eece4f1366d56ff50e5b41df6c2845fef0214ad (patch)
tree99856307405eefe819f385375658141a2e6a17ca /bundles/org.eclipse.equinox.p2.tests
parente193ccd994def3fd574aee5335e8cf8a1c610ae4 (diff)
downloadrt.equinox.p2-1eece4f1366d56ff50e5b41df6c2845fef0214ad.tar.gz
rt.equinox.p2-1eece4f1366d56ff50e5b41df6c2845fef0214ad.tar.xz
rt.equinox.p2-1eece4f1366d56ff50e5b41df6c2845fef0214ad.zip
Bug 422026 - Get rid of ColletionUtils.empty[Set|List|Map]
Now that p2 has Java 1.5 as a minimum there is no reason to not use the JVM methods. Change-Id: I89444e8d1e174c316e2b17fb4f53bc7b1d097c0a Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NegationTesting.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PermissiveSlicerTest.java18
4 files changed, 17 insertions, 23 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java
index 903f59fc3..4ef74d2a6 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java
@@ -18,7 +18,6 @@ import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.artifact.processors.md5.Messages;
-import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils;
import org.eclipse.equinox.internal.p2.director.PermissiveSlicer;
import org.eclipse.equinox.internal.p2.metadata.ArtifactKey;
import org.eclipse.equinox.internal.p2.metadata.InstallableUnit;
@@ -361,7 +360,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
runAntTask();
- PermissiveSlicer slicer = new PermissiveSlicer(repo, CollectionUtils.<String, String> emptyMap(), true, false, true, false, false);
+ PermissiveSlicer slicer = new PermissiveSlicer(repo, Collections.<String, String> emptyMap(), true, false, true, false, false);
IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor());
assertEquals("Different number of IUs", queryResultSize(result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())), getIUCount(destinationRepo));
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java
index 51f241f22..12b52360d 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java
@@ -18,7 +18,6 @@ import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.*;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils;
import org.eclipse.equinox.internal.p2.metadata.*;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.metadata.*;
@@ -317,7 +316,7 @@ public class SPIMetadataRepositoryTest extends AbstractProvisioningTest {
}
public List<IRequirement> getMetaRequirements() {
- return CollectionUtils.emptyList();
+ return Collections.<IRequirement> emptyList();
}
public String getProperty(String key, String locale) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NegationTesting.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NegationTesting.java
index c98b92d52..875884ad9 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NegationTesting.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NegationTesting.java
@@ -10,10 +10,8 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import java.util.ArrayList;
-import java.util.Collection;
+import java.util.*;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils;
import org.eclipse.equinox.internal.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.p2.director.Slicer;
import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan;
@@ -89,7 +87,7 @@ public class NegationTesting extends AbstractProvisioningTest {
IMetadataRepository repo = createTestMetdataRepository(new IInstallableUnit[] {iu1, iu2, iu3});
// Verify that the slice includes iu3 because the requirement from iu1 is a range including the provided capability of iu3.
- Slicer slicer = new Slicer(repo, CollectionUtils.<String, String> emptyMap(), false);
+ Slicer slicer = new Slicer(repo, Collections.<String, String> emptyMap(), false);
IQueryable slice = slicer.slice(new IInstallableUnit[] {iu1}, new NullProgressMonitor());
assertEquals(3, queryResultSize(slice.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())));
@@ -147,7 +145,7 @@ public class NegationTesting extends AbstractProvisioningTest {
IMetadataRepository repo = createTestMetdataRepository(new IInstallableUnit[] {iu1, iu2, iu3});
//Test the slicer. The slice will not contain iu3 because none of the range of iu1 cause it to be brought in.
- Slicer slicer = new Slicer(repo, CollectionUtils.<String, String> emptyMap(), false);
+ Slicer slicer = new Slicer(repo, Collections.<String, String> emptyMap(), false);
IQueryable slice = slicer.slice(new IInstallableUnit[] {iu1}, new NullProgressMonitor());
assertEquals(0, queryResultSize(slice.query(QueryUtil.createIUQuery("ProviderOf1_1_1"), new NullProgressMonitor())));
assertEquals(2, queryResultSize(slice.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())));
@@ -179,7 +177,7 @@ public class NegationTesting extends AbstractProvisioningTest {
IMetadataRepository repo = createTestMetdataRepository(new IInstallableUnit[] {iu1, iu2});
//Test the slicer. The slice will not contain iu3 because none of the range of iu1 cause it to be brought in.
- Slicer slicer = new Slicer(repo, CollectionUtils.<String, String> emptyMap(), false);
+ Slicer slicer = new Slicer(repo, Collections.<String, String> emptyMap(), false);
IQueryable slice = slicer.slice(new IInstallableUnit[] {iu1}, new NullProgressMonitor());
assertEquals(0, queryResultSize(slice.query(QueryUtil.createIUQuery("ProviderOf1_1_1"), new NullProgressMonitor())));
assertEquals(2, queryResultSize(slice.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())));
@@ -233,7 +231,7 @@ public class NegationTesting extends AbstractProvisioningTest {
IMetadataRepository repo = createTestMetdataRepository(new IInstallableUnit[] {iu1, iu2, iu3});
// Verify that the slice includes iu3 because the requirement from iu1 is a range including the provided capability of iu3.
- Slicer slicer = new Slicer(repo, CollectionUtils.<String, String> emptyMap(), false);
+ Slicer slicer = new Slicer(repo, Collections.<String, String> emptyMap(), false);
IQueryable slice = slicer.slice(new IInstallableUnit[] {iu1}, new NullProgressMonitor());
assertEquals(3, queryResultSize(slice.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())));
@@ -302,12 +300,12 @@ public class NegationTesting extends AbstractProvisioningTest {
IMetadataRepository repo = createTestMetdataRepository(new IInstallableUnit[] {iu1, iu2, iu3, iu4});
// Verify that the slice includes iu3
- Slicer slicer = new Slicer(repo, CollectionUtils.<String, String> emptyMap(), false);
+ Slicer slicer = new Slicer(repo, Collections.<String, String> emptyMap(), false);
IQueryable slice = slicer.slice(new IInstallableUnit[] {iu1, iu4}, new NullProgressMonitor());
assertEquals(4, queryResultSize(slice.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())));
// Verify that the slice includes iu3
- Slicer slicer2 = new Slicer(repo, CollectionUtils.<String, String> emptyMap(), false);
+ Slicer slicer2 = new Slicer(repo, Collections.<String, String> emptyMap(), false);
IQueryable slice2 = slicer2.slice(new IInstallableUnit[] {iu4}, new NullProgressMonitor());
assertEquals(2, queryResultSize(slice2.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())));
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PermissiveSlicerTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PermissiveSlicerTest.java
index 6b9421821..570c568d3 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PermissiveSlicerTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PermissiveSlicerTest.java
@@ -11,10 +11,8 @@
package org.eclipse.equinox.p2.tests.planner;
import java.io.File;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.*;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils;
import org.eclipse.equinox.internal.p2.director.PermissiveSlicer;
import org.eclipse.equinox.p2.metadata.*;
import org.eclipse.equinox.p2.query.*;
@@ -32,7 +30,7 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest {
}
public void testSliceRCPOut() {
- PermissiveSlicer slicer = new PermissiveSlicer(repo, CollectionUtils.<String, String> emptyMap(), true, false, true, false, false);
+ PermissiveSlicer slicer = new PermissiveSlicer(repo, Collections.<String, String> emptyMap(), true, false, true, false, false);
IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor());
@@ -45,7 +43,7 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest {
//Test with and without optional pieces
public void testSliceRCPWithOptionalPieces() {
- PermissiveSlicer slicer = new PermissiveSlicer(repo, CollectionUtils.<String, String> emptyMap(), false, false, true, false, false);
+ PermissiveSlicer slicer = new PermissiveSlicer(repo, Collections.<String, String> emptyMap(), false, false, true, false, false);
IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor());
@@ -56,7 +54,7 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest {
}
public void testSliceRCPWithIgnoringGreed() {
- PermissiveSlicer slicer = new PermissiveSlicer(repo, CollectionUtils.<String, String> emptyMap(), false, true, true, false, false);
+ PermissiveSlicer slicer = new PermissiveSlicer(repo, Collections.<String, String> emptyMap(), false, true, true, false, false);
IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor());
@@ -99,7 +97,7 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest {
}
public void testExtractPlatformIndependentPieces() {
- PermissiveSlicer slicer = new PermissiveSlicer(repo, CollectionUtils.<String, String> emptyMap(), true, false, false, false, false);
+ PermissiveSlicer slicer = new PermissiveSlicer(repo, Collections.<String, String> emptyMap(), true, false, false, false, false);
IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor());
@@ -117,7 +115,7 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest {
IRequirement[] metaReq = createRequiredCapabilities("p2.action", "action1", new VersionRange("[0.0.0, 1.0.0]"));
IInstallableUnit a = createIUWithMetaRequirement("A", DEFAULT_VERSION, true, NO_REQUIRES, metaReq);
- PermissiveSlicer slicer = new PermissiveSlicer(createTestMetdataRepository(new IInstallableUnit[] {a, act1}), CollectionUtils.<String, String> emptyMap(), true, false, false, false, false);
+ PermissiveSlicer slicer = new PermissiveSlicer(createTestMetdataRepository(new IInstallableUnit[] {a, act1}), Collections.<String, String> emptyMap(), true, false, false, false, false);
IQueryable result = slicer.slice(new IInstallableUnit[] {a}, new NullProgressMonitor());
assertEquals(1, queryResultSize(result.query(QueryUtil.createIUQuery("Action1"), null)));
}
@@ -137,7 +135,7 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest {
public void testMissingNecessaryPiece() {
IRequirement[] req = createRequiredCapabilities("B", "B", new VersionRange("[0.0.0, 1.0.0]"));
IInstallableUnit iuA = createIU("A", DEFAULT_VERSION, null, req, NO_PROVIDES, NO_PROPERTIES, null, NO_TP_DATA, true);
- PermissiveSlicer slicer = new PermissiveSlicer(createTestMetdataRepository(new IInstallableUnit[] {iuA}), CollectionUtils.<String, String> emptyMap(), true, false, false, false, false);
+ PermissiveSlicer slicer = new PermissiveSlicer(createTestMetdataRepository(new IInstallableUnit[] {iuA}), Collections.<String, String> emptyMap(), true, false, false, false, false);
IQueryable result = slicer.slice(new IInstallableUnit[] {iuA}, new NullProgressMonitor());
assertNotNull(result);
assertNotOK(slicer.getStatus());
@@ -156,7 +154,7 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest {
}
public void testExtractOnlyPlatformSpecific() {
- PermissiveSlicer slicer = new PermissiveSlicer(repo, CollectionUtils.<String, String> emptyMap(), true, false, true, false, true);
+ PermissiveSlicer slicer = new PermissiveSlicer(repo, Collections.<String, String> emptyMap(), true, false, true, false, true);
IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
IQueryResult resultCollector = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor()).query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor());

Back to the top