Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-09-19 08:41:18 +0000
committerAlexander Kurtakov2017-09-19 08:41:18 +0000
commit5b2a14f5019cb889a97f6604bd3fe16384104b93 (patch)
tree7f3fadd904d16f7fad8db5d318717fde724d5b6e
parentf84a32193287c0a7f00c7537b159ddb0ec1804e5 (diff)
downloadrt.equinox.p2-5b2a14f5019cb889a97f6604bd3fe16384104b93.tar.gz
rt.equinox.p2-5b2a14f5019cb889a97f6604bd3fe16384104b93.tar.xz
rt.equinox.p2-5b2a14f5019cb889a97f6604bd3fe16384104b93.zip
Bug 522466 - Fix generification warnings in p2.tests
First round of generifying everything faced. Change-Id: I78bb9ce2655caf41da22235b0ac85ad6ad922365 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractWrappedArtifactRepository.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestMetadataRepository.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java22
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/StatsTest.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/IUListFormatterTest.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/directorywatcher/DirectoryWatcherTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/embeddedequinox/EmbeddedEquinox.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/EngineTest.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ParameterizedProvisioningActionTest.java52
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileRegistryTest.java43
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileTest.java30
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/VariableTest3.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/IUPatchPersistenceTest.java25
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/IUPersistenceTest.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java34
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationArtifactTest.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/MetadataRepositoryPerformanceTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/PublisherPerformanceTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NegationTesting.java52
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/TestArtifactRepository.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AdviceMatcher.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/LocalUpdateSiteActionTest.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/MultiCapture.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootFilesActionTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootIUActionTest.java56
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/TestQueryReimplementation.java20
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/ReconcilerTestSuite.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddJVMArgumentActionTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddProgramArgumentActionTest.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddProgramPropertyActionTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddRepositoryActionTest.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddSourceBundleActionTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/CheckTrustActionTest.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/CollectActionTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/InstallBundleActionTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/InstallFeatureActionTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/JVMArgumentActionLogicTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/LinkActionTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/MarkStartedActionTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveJVMArgumentActionTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveProgramArgumentActionTest.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveProgramPropertyActionTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveSourceBundleActionTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetFrameworkDependentPropertyActionTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetFrameworkIndependentPropertyActionTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetLauncherNameActionTest.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetProgramPropertyActionTest.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetStartLevelActionTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/UninstallBundleActionTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/UninstallFeatureActionTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/ChmodActionTest.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/CleanupzipActionTest.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/CollectActionTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/CopyActionTest.java46
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/LinkActionTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/MkdirActionTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/RemoveActionTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/RmdirActionTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/UnzipActionTest.java8
61 files changed, 350 insertions, 375 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java
index 8379d733b..605117120 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java
@@ -1301,7 +1301,7 @@ public abstract class AbstractProvisioningTest extends TestCase {
}
public static void assertContains(String message, IQueryable source, IQueryable destination) {
- IQueryResult<IInstallableUnit> sourceCollector = source.query(QueryUtil.createIUAnyQuery(), null);
+ IQueryResult sourceCollector = source.query(QueryUtil.createIUAnyQuery(), null);
Iterator<IInstallableUnit> it = sourceCollector.iterator();
while (it.hasNext()) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractWrappedArtifactRepository.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractWrappedArtifactRepository.java
index a274711e8..6d60dcc0d 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractWrappedArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractWrappedArtifactRepository.java
@@ -159,7 +159,7 @@ public class AbstractWrappedArtifactRepository implements IArtifactRepository {
}
@Override
- public Map getProperties() {
+ public Map<String, String> getProperties() {
return delegate.getProperties();
}
@@ -204,7 +204,7 @@ public class AbstractWrappedArtifactRepository implements IArtifactRepository {
}
@Override
- public Object getAdapter(Class adapter) {
+ public <T> T getAdapter(Class<T> adapter) {
return delegate.getAdapter(adapter);
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestMetadataRepository.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestMetadataRepository.java
index fded4f4bd..0285c8d58 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestMetadataRepository.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestMetadataRepository.java
@@ -35,7 +35,7 @@ public class TestMetadataRepository extends AbstractMetadataRepository {
private static final String PROVIDER = "org.eclipse"; //$NON-NLS-1$
private static final String TYPE = "testmetadatarepo"; //$NON-NLS-1$
private static final String VERSION = "1"; //$NON-NLS-1$
- private final List units = new ArrayList();
+ private final List<IInstallableUnit> units = new ArrayList<>();
protected HashSet<IRepositoryReference> repositories = new HashSet<>();
private static URI createLocation() {
@@ -59,14 +59,14 @@ public class TestMetadataRepository extends AbstractMetadataRepository {
}
public IInstallableUnit find(String id, String versionString) {
- Iterator result = query(QueryUtil.createIUQuery(id, Version.create(versionString)), null).iterator();
- return (IInstallableUnit) (result.hasNext() ? result.next() : null);
+ Iterator<IInstallableUnit> result = query(QueryUtil.createIUQuery(id, Version.create(versionString)), null).iterator();
+ return result.hasNext() ? result.next() : null;
}
@Override
public <T> T getAdapter(Class<T> adapter) {
if (adapter == TestMetadataRepository.class || adapter == IMetadataRepository.class || adapter == IRepository.class) {
- return (T) this;
+ return adapter.cast(this);
}
return null;
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java
index 41e1dad13..95330953d 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java
@@ -81,7 +81,7 @@ public class SimpleArtifactRepositoryTest extends AbstractProvisioningTest {
repositoryFile = new File(tempDir, "SimpleArtifactRepositoryTest");
delete(repositoryFile);
repositoryURI = repositoryFile.toURI();
- Map properties = new HashMap();
+ Map<String, String> properties = new HashMap<>();
properties.put(IRepository.PROP_COMPRESSED, "true");
IArtifactRepository repo = artifactRepositoryManager.createRepository(repositoryURI, "artifact name", IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
@@ -114,7 +114,7 @@ public class SimpleArtifactRepositoryTest extends AbstractProvisioningTest {
repositoryFile = new File(tempDir, "SimpleArtifactRepositoryTest");
delete(repositoryFile);
repositoryURI = repositoryFile.toURI();
- Map properties = new HashMap();
+ Map<String, String> properties = new HashMap<>();
properties.put(IRepository.PROP_COMPRESSED, "false");
IArtifactRepository repo = artifactRepositoryManager.createRepository(repositoryURI, "artifact name", IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
@@ -248,7 +248,7 @@ public class SimpleArtifactRepositoryTest extends AbstractProvisioningTest {
descriptor.setProcessingSteps(new IProcessingStepDescriptor[] {new ProcessingStepDescriptor("org.eclipse.equinox.p2.processing.Pack200Unpacker", null, true)});
// Create repository
- Map properties = new HashMap();
+ Map<String, String> properties = new HashMap<>();
properties.put("publishPackFilesAsSiblings", Boolean.TRUE.toString());
SimpleArtifactRepository repo = (SimpleArtifactRepository) getArtifactRepositoryManager().createRepository(repositoryURI, "My Repo", IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
@@ -284,7 +284,7 @@ public class SimpleArtifactRepositoryTest extends AbstractProvisioningTest {
private static class TestDescriptor implements IArtifactDescriptor {
private static final IProcessingStepDescriptor[] steps = new IProcessingStepDescriptor[0];
private IArtifactKey artifactKey;
- private Properties properties = new Properties();
+ private Map<String, String> properties = new HashMap<>();
public TestDescriptor(IArtifactKey key) {
this.artifactKey = key;
@@ -301,13 +301,13 @@ public class SimpleArtifactRepositoryTest extends AbstractProvisioningTest {
}
@Override
- public Map getProperties() {
+ public Map<String, String> getProperties() {
return properties;
}
@Override
public String getProperty(String key) {
- return properties.getProperty(key);
+ return properties.get(key);
}
@Override
@@ -356,7 +356,7 @@ public class SimpleArtifactRepositoryTest extends AbstractProvisioningTest {
File folder = getTestFolder("simple_AddContains");
repositoryURI = folder.toURI();
- Map properties = new HashMap();
+ Map<String, String> properties = new HashMap<>();
SimpleArtifactRepository repo = (SimpleArtifactRepository) getArtifactRepositoryManager().createRepository(repositoryURI, "My Repo", IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
TestDescriptor descriptor = new TestDescriptor(new ArtifactKey("osgi.bundle", "aaPlugin", Version.create("1.0.0")));
@@ -374,7 +374,7 @@ public class SimpleArtifactRepositoryTest extends AbstractProvisioningTest {
File folder = getTestFolder("ArtifactRepository_testAddDescriptorPerformance");
repositoryURI = folder.toURI();
- IArtifactRepository repo = getArtifactRepositoryManager().createRepository(repositoryURI, "test", IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, new HashMap());
+ IArtifactRepository repo = getArtifactRepositoryManager().createRepository(repositoryURI, "test", IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, new HashMap<>());
long start = System.currentTimeMillis();
IProgressMonitor monitor = new NullProgressMonitor();
@@ -390,7 +390,7 @@ public class SimpleArtifactRepositoryTest extends AbstractProvisioningTest {
File folder = getTestFolder("ArtifactRepository_testAddDescriptorPerformanceExectuteBatch");
repositoryURI = folder.toURI();
- final IArtifactRepository repo = getArtifactRepositoryManager().createRepository(repositoryURI, "test", IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, new HashMap());
+ final IArtifactRepository repo = getArtifactRepositoryManager().createRepository(repositoryURI, "test", IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, new HashMap<>());
long start = System.currentTimeMillis();
repo.executeBatch(monitor -> {
@@ -408,7 +408,7 @@ public class SimpleArtifactRepositoryTest extends AbstractProvisioningTest {
File folder = getTestFolder("ArtifactRepository_testQuery");
repositoryURI = folder.toURI();
- IArtifactRepository repo = getArtifactRepositoryManager().createRepository(repositoryURI, "test", IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, new HashMap());
+ IArtifactRepository repo = getArtifactRepositoryManager().createRepository(repositoryURI, "test", IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, new HashMap<>());
ArtifactDescriptor d1 = new ArtifactDescriptor(new ArtifactKey("osgi.bundle", "a", Version.create("1.0.0")));
ArtifactDescriptor d2 = new ArtifactDescriptor(new ArtifactKey("osgi.bundle", "a", Version.create("2.0.0")));
@@ -439,7 +439,7 @@ public class SimpleArtifactRepositoryTest extends AbstractProvisioningTest {
public void testMaximumThreads() throws Exception {
File folder = getTestFolder("ArtifactRepository_testQuery");
repositoryURI = folder.toURI();
- IArtifactRepository repo = getArtifactRepositoryManager().createRepository(repositoryURI, "test", IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, new HashMap());
+ IArtifactRepository repo = getArtifactRepositoryManager().createRepository(repositoryURI, "test", IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, new HashMap<>());
Method getMaximumThreads = SimpleArtifactRepository.class.getDeclaredMethod("getMaximumThreads");
getMaximumThreads.setAccessible(true);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/StatsTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/StatsTest.java
index 05f9f1cfb..0b5146689 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/StatsTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/StatsTest.java
@@ -56,7 +56,7 @@ public class StatsTest extends AbstractTestServerClientCase {
repositoryFile = new File(tempDir, "SimpleArtifactRepositoryTest");
AbstractProvisioningTest.delete(repositoryFile);
repositoryURI = repositoryFile.toURI();
- Map properties = new HashMap();
+ Map<String, String> properties = new HashMap<>();
properties.put(IRepository.PROP_COMPRESSED, "true");
statsURL = URI.create(getBaseURL() + "/stats");
properties.put("p2.statsURI", statsURL.toString());
@@ -72,7 +72,7 @@ public class StatsTest extends AbstractTestServerClientCase {
sourceRepo.addDescriptors(descriptors, null);
IMetadataRepositoryManager manager = (IMetadataRepositoryManager) getAgent().getService(IMetadataRepositoryManager.SERVICE_NAME);
- properties = new HashMap();
+ properties = new HashMap<>();
properties.put(IRepository.PROP_COMPRESSED, "true");
metaRepo = manager.createRepository(repositoryURI, "TestRepo", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
@@ -80,7 +80,7 @@ public class StatsTest extends AbstractTestServerClientCase {
descriptor.setId("testIuId");
descriptor.setVersion(Version.create("1.0.0"));
descriptor.setArtifacts(new IArtifactKey[] {key});
- Collection providedCaps = new ArrayList();
+ Collection<IProvidedCapability> providedCaps = new ArrayList<>();
providedCaps.add(MetadataFactory.createProvidedCapability(IInstallableUnit.NAMESPACE_IU_ID, descriptor.getId(), descriptor.getVersion()));
descriptor.addProvidedCapabilities(providedCaps);
descriptor.setMetaRequirements(new IRequirement[] {MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, descriptor.getId(), new VersionRange(descriptor.getVersion(), true, Version.MAX_VERSION, false), null, false, false)});
@@ -150,7 +150,7 @@ public class StatsTest extends AbstractTestServerClientCase {
public void testDownloadStatsWhileInstall() throws AuthenticationFailedException, FileNotFoundException, CoreException, IOException {
IProfileRegistry registry = (IProfileRegistry) getAgent().getService(IProfileRegistry.SERVICE_NAME);
final String profileName = "downloadStats";
- Map properties = new HashMap();
+ Map<String, String> properties = new HashMap<>();
properties.put(IProfile.PROP_STATS_PARAMETERS, "os=linux&ws=gtk&package=jee");
String tempDir = System.getProperty("java.io.tmpdir");
testInstall = new File(tempDir, "statsTestInstall");
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/IUListFormatterTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/IUListFormatterTest.java
index 357995cf3..333967bbd 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/IUListFormatterTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/IUListFormatterTest.java
@@ -69,8 +69,8 @@ public class IUListFormatterTest extends TestCase {
properties.put(IInstallableUnit.PROP_NAME, name);
properties.put(IInstallableUnit.PROP_DESCRIPTION, description);
expect(iu.getProperties()).andStubReturn(properties);
- expect(iu.getProperty((String) anyObject())).andStubAnswer(new MapAnswer(properties));
- expect(iu.getProperty((String) anyObject(), (String) anyObject())).andStubAnswer(new MapAnswer(properties));
+ expect(iu.getProperty((String) anyObject())).andStubAnswer(new MapAnswer<>(properties));
+ expect(iu.getProperty((String) anyObject(), (String) anyObject())).andStubAnswer(new MapAnswer<>(properties));
replay(iu);
return iu;
}
@@ -85,8 +85,8 @@ public class IUListFormatterTest extends TestCase {
properties.put("prop_" + i, "propValue_" + i);
}
expect(iu.getProperties()).andStubReturn(properties);
- expect(iu.getProperty((String) anyObject())).andStubAnswer(new MapAnswer(properties));
- expect(iu.getProperty((String) anyObject(), (String) anyObject())).andStubAnswer(new MapAnswer(properties));
+ expect(iu.getProperty((String) anyObject())).andStubAnswer(new MapAnswer<>(properties));
+ expect(iu.getProperty((String) anyObject(), (String) anyObject())).andStubAnswer(new MapAnswer<>(properties));
replay(iu);
return iu;
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/directorywatcher/DirectoryWatcherTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/directorywatcher/DirectoryWatcherTest.java
index b5cd016f4..5482012ec 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/directorywatcher/DirectoryWatcherTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/directorywatcher/DirectoryWatcherTest.java
@@ -46,7 +46,7 @@ public class DirectoryWatcherTest extends AbstractProvisioningTest {
URL base = TestActivator.getContext().getBundle().getEntry("/testData/directorywatcher1");
File folder = new File(FileLocator.toFileURL(base).getPath());
- Hashtable props = new Hashtable();
+ Hashtable<String, String> props = new Hashtable<>();
props.put(DirectoryWatcher.DIR, folder.getAbsolutePath());
DirectoryWatcher watcher = new DirectoryWatcher(props, TestActivator.getContext());
@@ -58,11 +58,11 @@ public class DirectoryWatcherTest extends AbstractProvisioningTest {
URL base = TestActivator.getContext().getBundle().getEntry("/testData/directorywatcher1");
File folder = new File(FileLocator.toFileURL(base).getPath());
- Hashtable props = new Hashtable();
+ Hashtable<String, String> props = new Hashtable<>();
props.put(DirectoryWatcher.DIR, folder.getAbsolutePath());
DirectoryWatcher watcher = new DirectoryWatcher(props, TestActivator.getContext());
- final List list = Collections.synchronizedList(new ArrayList());
+ final List<File> list = Collections.synchronizedList(new ArrayList<>());
DirectoryChangeListener listener = new DirectoryChangeListener() {
@Override
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/embeddedequinox/EmbeddedEquinox.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/embeddedequinox/EmbeddedEquinox.java
index f41b2fb1e..484709afe 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/embeddedequinox/EmbeddedEquinox.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/embeddedequinox/EmbeddedEquinox.java
@@ -25,7 +25,7 @@ import org.osgi.framework.BundleContext;
public class EmbeddedEquinox {
private final Map frameworkProperties;
private final String[] frameworkArgs;
- private Class eclipseStarterClazz;
+ private Class<?> eclipseStarterClazz;
private BundleContext context;
private URL[] frameworkClassPath;
@@ -43,10 +43,10 @@ public class EmbeddedEquinox {
URLClassLoader frameworkLoader = new FrameworkClassLoader(frameworkClassPath, this.getClass().getClassLoader());
eclipseStarterClazz = frameworkLoader.loadClass("org.eclipse.core.runtime.adaptor.EclipseStarter");
- Method setInitialProperties = eclipseStarterClazz.getMethod("setInitialProperties", new Class[] {Map.class}); //$NON-NLS-1$
+ Method setInitialProperties = eclipseStarterClazz.getMethod("setInitialProperties", Map.class); //$NON-NLS-1$
setInitialProperties.invoke(null, new Object[] {frameworkProperties});
- Method runMethod = eclipseStarterClazz.getMethod("startup", new Class[] {String[].class, Runnable.class}); //$NON-NLS-1$
+ Method runMethod = eclipseStarterClazz.getMethod("startup", String[].class, Runnable.class); //$NON-NLS-1$
context = (BundleContext) runMethod.invoke(null, new Object[] {frameworkArgs, null});
} catch (Throwable t) {
if (t instanceof RuntimeException)
@@ -77,7 +77,7 @@ public class EmbeddedEquinox {
}
@Override
- protected Class findClass(String name) throws ClassNotFoundException {
+ protected Class<?> findClass(String name) throws ClassNotFoundException {
if (name.startsWith("org.osgi.framework.") || name.startsWith("org.osgi.resource."))
// TODO this should call findClass; but then have to use reflection!!
return embeddedBundleLoader.loadClass(name);
@@ -93,7 +93,7 @@ public class EmbeddedEquinox {
}
@Override
- public Enumeration findResources(String name) throws IOException {
+ public Enumeration<URL> findResources(String name) throws IOException {
if (name.startsWith("org/osgi/framework/") || name.startsWith("org/osgi/resource/"))
// TODO this should call findResources; but then have to use reflection!!
return embeddedBundleLoader.getResources(name);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/EngineTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/EngineTest.java
index 39cd4820c..fc983c2ee 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/EngineTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/EngineTest.java
@@ -46,25 +46,25 @@ public class EngineTest extends AbstractProvisioningTest {
}
@Override
- protected IStatus completeOperand(IProfile profile, Operand operand, Map parameters, IProgressMonitor monitor) {
+ protected IStatus completeOperand(IProfile profile, Operand operand, Map<String, Object> parameters, IProgressMonitor monitor) {
operandCount--;
return super.completeOperand(profile, operand, parameters, monitor);
}
@Override
- protected IStatus completePhase(IProgressMonitor monitor, IProfile profile, Map parameters) {
+ protected IStatus completePhase(IProgressMonitor monitor, IProfile profile, Map<String, Object> parameters) {
phaseCount--;
return super.completePhase(monitor, profile, parameters);
}
@Override
- protected IStatus initializeOperand(IProfile profile, Operand operand, Map parameters, IProgressMonitor monitor) {
+ protected IStatus initializeOperand(IProfile profile, Operand operand, Map<String, Object> parameters, IProgressMonitor monitor) {
operandCount++;
return super.initializeOperand(profile, operand, parameters, monitor);
}
@Override
- protected IStatus initializePhase(IProgressMonitor monitor, IProfile profile, Map parameters) {
+ protected IStatus initializePhase(IProgressMonitor monitor, IProfile profile, Map<String, Object> parameters) {
phaseCount++;
return super.initializePhase(monitor, profile, parameters);
}
@@ -774,7 +774,7 @@ public class EngineTest extends AbstractProvisioningTest {
}
@Override
- public Map getInstallableUnitProperties(IInstallableUnit iu) {
+ public Map<String, String> getInstallableUnitProperties(IInstallableUnit iu) {
return null;
}
@@ -789,7 +789,7 @@ public class EngineTest extends AbstractProvisioningTest {
}
@Override
- public Map getProperties() {
+ public Map<String, String> getProperties() {
return null;
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ParameterizedProvisioningActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ParameterizedProvisioningActionTest.java
index d8053e762..27e7814c8 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ParameterizedProvisioningActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ParameterizedProvisioningActionTest.java
@@ -24,13 +24,13 @@ public class ParameterizedProvisioningActionTest extends AbstractProvisioningTes
ProvisioningAction action = new ProvisioningAction() {
@Override
- public IStatus execute(Map parameters) {
+ public IStatus execute(Map<String, Object> parameters) {
value = (String) parameters.get("test");
return null;
}
@Override
- public IStatus undo(Map parameters) {
+ public IStatus undo(Map<String, Object> parameters) {
return null;
}
};
@@ -42,10 +42,10 @@ public class ParameterizedProvisioningActionTest extends AbstractProvisioningTes
public void testBasicParameter() {
value = null;
- Map actionParameters = new HashMap();
+ Map<String, String> actionParameters = new HashMap<>();
actionParameters.put("test", "testValue");
- Map phaseParameters = new HashMap();
+ Map<String, Object> phaseParameters = new HashMap<>();
ParameterizedProvisioningAction pAction = new ParameterizedProvisioningAction(action, actionParameters, null);
pAction.execute(phaseParameters);
@@ -55,10 +55,10 @@ public class ParameterizedProvisioningActionTest extends AbstractProvisioningTes
public void testVariableParameter() {
passTest = false;
- Map actionParameters = new HashMap();
+ Map<String, String> actionParameters = new HashMap<>();
actionParameters.put("test", "test${variable}");
- Map phaseParameters = new HashMap();
+ Map<String, Object> phaseParameters = new HashMap<>();
phaseParameters.put("variable", "Value");
ParameterizedProvisioningAction pAction = new ParameterizedProvisioningAction(action, actionParameters, null);
pAction.execute(phaseParameters);
@@ -68,10 +68,10 @@ public class ParameterizedProvisioningActionTest extends AbstractProvisioningTes
public void testEscapedCharacterParameter() {
passTest = false;
- Map actionParameters = new HashMap();
+ Map<String, String> actionParameters = new HashMap<>();
actionParameters.put("test", "testV${#97}lue");
- Map phaseParameters = new HashMap();
+ Map<String, Object> phaseParameters = new HashMap<>();
phaseParameters.put("variable", "Value");
ParameterizedProvisioningAction pAction = new ParameterizedProvisioningAction(action, actionParameters, null);
@@ -82,10 +82,10 @@ public class ParameterizedProvisioningActionTest extends AbstractProvisioningTes
public void testOutOfRangeEscapedCharacterParameter() {
passTest = false;
- Map actionParameters = new HashMap();
+ Map<String, String> actionParameters = new HashMap<>();
actionParameters.put("test", "${#999999999999999999999999999999999999999999999}");
- Map phaseParameters = new HashMap();
+ Map<String, Object> phaseParameters = new HashMap<>();
phaseParameters.put("variable", "Value");
ParameterizedProvisioningAction pAction = new ParameterizedProvisioningAction(action, actionParameters, null);
@@ -96,10 +96,10 @@ public class ParameterizedProvisioningActionTest extends AbstractProvisioningTes
public void testLargerThanCharEscapedCharacterParameter() {
passTest = false;
- Map actionParameters = new HashMap();
+ Map<String, String> actionParameters = new HashMap<>();
actionParameters.put("test", "testV${#65633}lue"); // #65633 should be "a" if we allow overflow but we do not so null
- Map phaseParameters = new HashMap();
+ Map<String, Object> phaseParameters = new HashMap<>();
phaseParameters.put("variable", "Value");
ParameterizedProvisioningAction pAction = new ParameterizedProvisioningAction(action, actionParameters, null);
@@ -110,10 +110,10 @@ public class ParameterizedProvisioningActionTest extends AbstractProvisioningTes
public void testNegativeOutOfRangeCharEscapedCharacterParameter() {
passTest = false;
- Map actionParameters = new HashMap();
+ Map<String, String> actionParameters = new HashMap<>();
actionParameters.put("test", "testV${#-65439}lue"); // #65633 should be "a" if we allow underflow but we do not so null
- Map phaseParameters = new HashMap();
+ Map<String, Object> phaseParameters = new HashMap<>();
phaseParameters.put("variable", "Value");
ParameterizedProvisioningAction pAction = new ParameterizedProvisioningAction(action, actionParameters, null);
@@ -124,10 +124,10 @@ public class ParameterizedProvisioningActionTest extends AbstractProvisioningTes
public void testNotNumberEscapedCharacterParameter() {
passTest = false;
- Map actionParameters = new HashMap();
+ Map<String, String> actionParameters = new HashMap<>();
actionParameters.put("test", "${#xFFFF}");
- Map phaseParameters = new HashMap();
+ Map<String, Object> phaseParameters = new HashMap<>();
phaseParameters.put("variable", "Value");
ParameterizedProvisioningAction pAction = new ParameterizedProvisioningAction(action, actionParameters, null);
@@ -138,10 +138,10 @@ public class ParameterizedProvisioningActionTest extends AbstractProvisioningTes
public void testNaughtyEscapedCharactersParameter() {
passTest = false;
- Map actionParameters = new HashMap();
+ Map<String, String> actionParameters = new HashMap<>();
actionParameters.put("test", "${#36} ${#44} ${#58} ${#59} ${#123} ${#125}");
- Map phaseParameters = new HashMap();
+ Map<String, Object> phaseParameters = new HashMap<>();
phaseParameters.put("variable", "Value");
ParameterizedProvisioningAction pAction = new ParameterizedProvisioningAction(action, actionParameters, null);
@@ -152,10 +152,10 @@ public class ParameterizedProvisioningActionTest extends AbstractProvisioningTes
public void testNullCharEscapedCharactersParameter() {
passTest = false;
- Map actionParameters = new HashMap();
+ Map<String, String> actionParameters = new HashMap<>();
actionParameters.put("test", "a${#0}b");
- Map phaseParameters = new HashMap();
+ Map<String, Object> phaseParameters = new HashMap<>();
phaseParameters.put("variable", "Value");
ParameterizedProvisioningAction pAction = new ParameterizedProvisioningAction(action, actionParameters, null);
@@ -166,10 +166,10 @@ public class ParameterizedProvisioningActionTest extends AbstractProvisioningTes
public void testMaxCharEscapedCharactersParameter() {
passTest = false;
- Map actionParameters = new HashMap();
+ Map<String, String> actionParameters = new HashMap<>();
actionParameters.put("test", "a${#65535}b");
- Map phaseParameters = new HashMap();
+ Map<String, Object> phaseParameters = new HashMap<>();
phaseParameters.put("variable", "Value");
ParameterizedProvisioningAction pAction = new ParameterizedProvisioningAction(action, actionParameters, null);
@@ -180,10 +180,10 @@ public class ParameterizedProvisioningActionTest extends AbstractProvisioningTes
public void testOverMaxCharEscapedCharactersParameter() {
passTest = false;
- Map actionParameters = new HashMap();
+ Map<String, String> actionParameters = new HashMap<>();
actionParameters.put("test", "a${#65536}b");
- Map phaseParameters = new HashMap();
+ Map<String, Object> phaseParameters = new HashMap<>();
phaseParameters.put("variable", "Value");
ParameterizedProvisioningAction pAction = new ParameterizedProvisioningAction(action, actionParameters, null);
@@ -194,10 +194,10 @@ public class ParameterizedProvisioningActionTest extends AbstractProvisioningTes
public void testUnderMinCharEscapedCharactersParameter() {
passTest = false;
- Map actionParameters = new HashMap();
+ Map<String, String> actionParameters = new HashMap<>();
actionParameters.put("test", "a${#-1}b");
- Map phaseParameters = new HashMap();
+ Map<String, Object> phaseParameters = new HashMap<>();
phaseParameters.put("variable", "Value");
ParameterizedProvisioningAction pAction = new ParameterizedProvisioningAction(action, actionParameters, null);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileRegistryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileRegistryTest.java
index 9fb913f22..b82f65d1c 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileRegistryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileRegistryTest.java
@@ -302,11 +302,11 @@ public class ProfileRegistryTest extends AbstractProvisioningTest {
simpleRgy.lockProfile(simpleProfile);
simpleRgy.unlockProfile(simpleProfile);
// Create a lock file to confirm locking
-
+
File lockDirectory = new File(getResourceAsBundleRelFile("testData/engineTest/SimpleRegistry/"), SIMPLE_PROFILE + ".profile");
File lockFile = new File(lockDirectory, ".lock");
assertTrue("Lock file does not exist", lockFile.exists());
-
+
ProfileLock profileLock = new ProfileLock(lockDirectory);
boolean locked = profileLock.lock();
try {
@@ -559,19 +559,9 @@ public class ProfileRegistryTest extends AbstractProvisioningTest {
fail();
}
File profileFolder = new File(folder, getName() + ".profile");
- File[] filesFound = profileFolder.listFiles(new FileFilter() {
- @Override
- public boolean accept(File pathname) {
- return pathname.getName().endsWith(".profile");
- }
- });
+ File[] filesFound = profileFolder.listFiles((FileFilter) pathname -> pathname.getName().endsWith(".profile"));
assertEquals(1, filesFound.length);
- filesFound = profileFolder.listFiles(new FileFilter() {
- @Override
- public boolean accept(File pathname) {
- return pathname.getName().endsWith(".profile.gz");
- }
- });
+ filesFound = profileFolder.listFiles((FileFilter) pathname -> pathname.getName().endsWith(".profile.gz"));
assertEquals(0, filesFound.length);
}
@@ -611,15 +601,12 @@ public class ProfileRegistryTest extends AbstractProvisioningTest {
fail("1.4", e);
}
File profileFolder = new File(folder, getName() + ".profile");
- profileFolder.listFiles(new FileFilter() {
- @Override
- public boolean accept(File pathname) {
- if (pathname.getName().endsWith(".profile"))
- assertEquals("2.0." + currentValue, EngineActivator.PROFILE_FORMAT_UNCOMPRESSED, currentValue);
- else if (pathname.getName().endsWith(".profile.gz"))
- assertFalse("2.1." + currentValue, EngineActivator.PROFILE_FORMAT_UNCOMPRESSED.equals(currentValue));
- return false;
- }
+ profileFolder.listFiles((FileFilter) pathname -> {
+ if (pathname.getName().endsWith(".profile"))
+ assertEquals("2.0." + currentValue, EngineActivator.PROFILE_FORMAT_UNCOMPRESSED, currentValue);
+ else if (pathname.getName().endsWith(".profile.gz"))
+ assertFalse("2.1." + currentValue, EngineActivator.PROFILE_FORMAT_UNCOMPRESSED.equals(currentValue));
+ return false;
});
}
} finally {
@@ -652,13 +639,7 @@ public class ProfileRegistryTest extends AbstractProvisioningTest {
fail();
}
File profileFolder = new File(folder, getName() + ".profile");
- File[] filesFound = profileFolder.listFiles(new FileFilter() {
-
- @Override
- public boolean accept(File pathname) {
- return pathname.getName().endsWith(".profile.gz");
- }
- });
+ File[] filesFound = profileFolder.listFiles((FileFilter) pathname -> pathname.getName().endsWith(".profile.gz"));
assertEquals(1, filesFound.length);
}
@@ -1019,7 +1000,7 @@ public class ProfileRegistryTest extends AbstractProvisioningTest {
stateProperties2.put("a", "c");
stateProperties2.put("zz", "yy");
- List keys = Arrays.asList(new String[] {"one", "a", "none"});
+ List<String> keys = Arrays.asList(new String[] {"one", "a", "none"});
// Test removing before any sets. (I.E. file does not exist)
assertOK(registry.removeProfileStateProperties(profile.getProfileId(), 1, keys));
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileTest.java
index 425fbec3c..752ba23a2 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileTest.java
@@ -141,8 +141,8 @@ public class ProfileTest extends AbstractProvisioningTest {
}
@Override
- public IQueryResult queryProfile(IProfile profile, IQuery query, IProgressMonitor monitor) {
- return new Collector();
+ public IQueryResult<IInstallableUnit> queryProfile(IProfile profile, IQuery<IInstallableUnit> query, IProgressMonitor monitor) {
+ return new Collector<>();
}
});
@@ -260,32 +260,32 @@ public class ProfileTest extends AbstractProvisioningTest {
protected class ProfilesHandler extends AbstractHandler {
- private final Map profileHandlers;
+ private final Map<String, ProfileHandler> profileHandlers;
public ProfilesHandler(AbstractHandler parentHandler, Attributes attributes) {
super(parentHandler, PROFILES_ELEMENT);
String size = parseOptionalAttribute(attributes, COLLECTION_SIZE_ATTRIBUTE);
- profileHandlers = (size != null ? new HashMap(Integer.parseInt(size)) : new HashMap(4));
+ profileHandlers = (size != null ? new HashMap<>(Integer.parseInt(size)) : new HashMap<>(4));
}
public IProfile[] getProfiles() {
if (profileHandlers.isEmpty())
return new IProfile[0];
- Map profileMap = new LinkedHashMap();
- for (Iterator it = profileHandlers.keySet().iterator(); it.hasNext();) {
- String profileId = (String) it.next();
+ Map<String, IProfile> profileMap = new LinkedHashMap<>();
+ for (Iterator<String> it = profileHandlers.keySet().iterator(); it.hasNext();) {
+ String profileId = it.next();
addProfile(profileId, profileMap);
}
- return (IProfile[]) profileMap.values().toArray(new IProfile[profileMap.size()]);
+ return profileMap.values().toArray(new IProfile[profileMap.size()]);
}
- private void addProfile(String profileId, Map profileMap) {
+ private void addProfile(String profileId, Map<String, IProfile> profileMap) {
if (profileMap.containsKey(profileId))
return;
- ProfileHandler profileHandler = (ProfileHandler) profileHandlers.get(profileId);
+ ProfileHandler profileHandler = profileHandlers.get(profileId);
Profile parentProfile = null;
String parentId = profileHandler.getParentId();
@@ -301,12 +301,12 @@ public class ProfileTest extends AbstractProvisioningTest {
for (int i = 0; i < ius.length; i++) {
IInstallableUnit iu = ius[i];
profile.addInstallableUnit(iu);
- Map iuProperties = profileHandler.getIUProperties(iu);
+ Map<String, String> iuProperties = profileHandler.getIUProperties(iu);
if (iuProperties != null) {
- for (Iterator it = iuProperties.entrySet().iterator(); it.hasNext();) {
- Entry entry = (Entry) it.next();
- String key = (String) entry.getKey();
- String value = (String) entry.getValue();
+ for (Iterator<Entry<String, String>> it = iuProperties.entrySet().iterator(); it.hasNext();) {
+ Entry<String, String> entry = it.next();
+ String key = entry.getKey();
+ String value = entry.getValue();
profile.setInstallableUnitProperty(iu, key, value);
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/VariableTest3.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/VariableTest3.java
index a00a3063e..7b1e70cf6 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/VariableTest3.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/VariableTest3.java
@@ -25,7 +25,7 @@ public class VariableTest3 extends AbstractProvisioningTest {
InstallableUnitDescription description = new MetadataFactory.InstallableUnitDescription();
description.setId("artifactWithZip");
description.setVersion(Version.create("1.0.0"));
- Map touchpointData = new HashMap();
+ Map<String, Object> touchpointData = new HashMap<>();
touchpointData.put("install", "test.actionForVariableTesting3( arg1: val1 ); test.actionForVariableTesting3 ( arg1: ${lastResult}); test.actionForVariableTesting3( arg1: ${lastResult} );");
description.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData));
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/IUPatchPersistenceTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/IUPatchPersistenceTest.java
index 142e38294..980c5b2d1 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/IUPatchPersistenceTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/IUPatchPersistenceTest.java
@@ -18,6 +18,7 @@ import org.eclipse.equinox.internal.p2.metadata.*;
import org.eclipse.equinox.internal.p2.metadata.repository.io.MetadataParser;
import org.eclipse.equinox.internal.p2.metadata.repository.io.MetadataWriter;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription;
import org.eclipse.equinox.p2.metadata.expression.IMatchExpression;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
import org.eclipse.equinox.p2.tests.TestActivator;
@@ -64,7 +65,7 @@ public class IUPatchPersistenceTest extends AbstractProvisioningTest {
new String[] {"configure", "addProgramArg(programArg:-startup);addProgramArg(programArg:@artifact);"}}; //
public static IInstallableUnit createPersistenceTestIU() {
- Map propertyMap = createProperties(properties);
+ Map<String, String> propertyMap = createProperties(properties);
IProvidedCapability[] additionalProvides = createProvided(provides);
IRequirement[] requirements = createRequired(requires);
IRequirement[] metaRequirements = createRequired(metaRequires);
@@ -79,7 +80,7 @@ public class IUPatchPersistenceTest extends AbstractProvisioningTest {
return MetadataFactory.createUpdateDescriptor(id, new VersionRange(IU_TEST_VERSION, true, IU_TEST_VERSION, true), IUpdateDescriptor.HIGH, "desc");
}
- private static Map createProperties(String[][] keyValuePairs) {
+ private static Map<String, String> createProperties(String[][] keyValuePairs) {
OrderedProperties props = new OrderedProperties(keyValuePairs.length);
for (int i = 0; i < keyValuePairs.length; i++) {
String[] nextPair = keyValuePairs[i];
@@ -108,7 +109,7 @@ public class IUPatchPersistenceTest extends AbstractProvisioningTest {
}
private static ITouchpointData createTouchpointData(String[][] instructionData) {
- Map map = new LinkedHashMap(instructionData.length);
+ Map<String, Object> map = new LinkedHashMap<>(instructionData.length);
for (int i = 0; i < instructionData.length; i++) {
String[] nextInstruction = instructionData[i];
map.put(nextInstruction[0], nextInstruction[1]);
@@ -182,7 +183,7 @@ public class IUPatchPersistenceTest extends AbstractProvisioningTest {
private InstallableUnitHandler iuHandler = null;
private InstallableUnit iu = null;
- private List singleton = new ArrayList(1);
+ private List<InstallableUnitDescription> singleton = new ArrayList<>(1);
public TestHandler() {
super();
@@ -278,7 +279,7 @@ public class IUPatchPersistenceTest extends AbstractProvisioningTest {
}
private IInstallableUnitPatch createPatchIU() {
- Map propertyMap = createProperties(properties);
+ Map<String, String> propertyMap = createProperties(properties);
IProvidedCapability[] additionalProvides = createProvided(provides);
IRequirement[] requirements = createRequired(requires);
IRequirement[] metaRequirements = createRequired(metaRequires);
@@ -324,13 +325,13 @@ public class IUPatchPersistenceTest extends AbstractProvisioningTest {
}
private static String[][] extractProperties(IInstallableUnit iu) {
- Map props = iu.getProperties();
- Set keys = props.keySet();
+ Map<String, String> props = iu.getProperties();
+ Set<String> keys = props.keySet();
String[][] pairs = new String[keys.size()][2];
int index = 0;
- for (Iterator iter = keys.iterator(); iter.hasNext();) {
- String nextKey = (String) iter.next();
- String nextValue = (String) props.get(nextKey);
+ for (Iterator<String> iter = keys.iterator(); iter.hasNext();) {
+ String nextKey = iter.next();
+ String nextValue = props.get(nextKey);
pairs[index] = new String[] {nextKey, nextValue};
index++;
}
@@ -361,7 +362,7 @@ public class IUPatchPersistenceTest extends AbstractProvisioningTest {
Collection<IRequirement> reqs = iu.getRequirements();
String[][] tuples = new String[reqs.size()][4];
int i = 0;
- for (Iterator iterator = reqs.iterator(); iterator.hasNext();) {
+ for (Iterator<IRequirement> iterator = reqs.iterator(); iterator.hasNext();) {
IRequiredCapability next = (IRequiredCapability) iterator.next();
tuples[i++] = new String[] {next.getNamespace(), next.getName(), next.getRange().toString(), Boolean.valueOf(next.getMin() == 0).toString()};
}
@@ -372,7 +373,7 @@ public class IUPatchPersistenceTest extends AbstractProvisioningTest {
Collection<IRequirement> requyres = iu.getMetaRequirements();
String[][] tuples = new String[requyres.size()][4];
int i = 0;
- for (Iterator iterator = requyres.iterator(); iterator.hasNext();) {
+ for (Iterator<IRequirement> iterator = requyres.iterator(); iterator.hasNext();) {
IRequiredCapability next = (IRequiredCapability) iterator.next();
tuples[i++] = new String[] {next.getNamespace(), next.getName(), next.getRange().toString(), Boolean.valueOf(next.getMin() == 0).toString()};
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/IUPersistenceTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/IUPersistenceTest.java
index 75afe5f5f..b8fef411c 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/IUPersistenceTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/IUPersistenceTest.java
@@ -19,6 +19,7 @@ import org.eclipse.equinox.internal.p2.metadata.*;
import org.eclipse.equinox.internal.p2.metadata.repository.io.MetadataParser;
import org.eclipse.equinox.internal.p2.metadata.repository.io.MetadataWriter;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription;
import org.eclipse.equinox.p2.metadata.expression.IMatchExpression;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
import org.eclipse.equinox.p2.tests.TestActivator;
@@ -51,7 +52,7 @@ public class IUPersistenceTest extends AbstractProvisioningTest {
private InstallableUnit iu = null;
private InstallableUnitHandler iuHandler = null;
- private List singleton = new ArrayList(1);
+ private List<InstallableUnitDescription> singleton = new ArrayList<>(1);
public TestHandler() {
super();
@@ -223,7 +224,7 @@ public class IUPersistenceTest extends AbstractProvisioningTest {
}
private static ITouchpointData createTouchpointData(String[][] instructionData) {
- Map map = new LinkedHashMap(instructionData.length);
+ Map<String, Object> map = new LinkedHashMap<>(instructionData.length);
for (int i = 0; i < instructionData.length; i++) {
String[] nextInstruction = instructionData[i];
map.put(nextInstruction[0], nextInstruction[1]);
@@ -249,7 +250,7 @@ public class IUPersistenceTest extends AbstractProvisioningTest {
Collection<IRequirement> requyres = iu.getRequirements();
String[][] tuples = new String[requyres.size()][4];
int i = 0;
- for (Iterator iterator = requyres.iterator(); iterator.hasNext();) {
+ for (Iterator<IRequirement> iterator = requyres.iterator(); iterator.hasNext();) {
IRequiredCapability next = (IRequiredCapability) iterator.next();
tuples[i++] = new String[] {next.getNamespace(), next.getName(), next.getRange().toString(), Boolean.valueOf(next.getMin() == 0).toString()};
}
@@ -260,7 +261,7 @@ public class IUPersistenceTest extends AbstractProvisioningTest {
Collection<IRequirement> requyres = iu.getMetaRequirements();
String[][] tuples = new String[requyres.size()][4];
int i = 0;
- for (Iterator iterator = requyres.iterator(); iterator.hasNext();) {
+ for (Iterator<IRequirement> iterator = requyres.iterator(); iterator.hasNext();) {
IRequiredCapability next = (IRequiredCapability) iterator.next();
tuples[i++] = new String[] {next.getNamespace(), next.getName(), next.getRange().toString(), Boolean.valueOf(next.getMin() == 0).toString()};
}
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 37f8355d5..578575d2d 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
@@ -229,16 +229,16 @@ public class SPIMetadataRepositoryTest extends AbstractProvisioningTest {
class SPIInstallableUnit implements IInstallableUnit {
- List artifacts = new ArrayList();
- List fragments = new ArrayList();
- List requiredCapabilities = new ArrayList();
- List providedCapabilities = new ArrayList();
- List touchpointData = new ArrayList();
+ List<IArtifactKey> artifacts = new ArrayList<>();
+ List<IInstallableUnitFragment> fragments = new ArrayList<>();
+ List<IRequirement> requiredCapabilities = new ArrayList<>();
+ List<IProvidedCapability> providedCapabilities = new ArrayList<>();
+ List<ITouchpointData> touchpointData = new ArrayList<>();
ICopyright copyright = null;
IMatchExpression<IInstallableUnit> filter = null;
String id = null;
Collection<ILicense> license = null;
- Map properties = new HashMap();
+ Map<String, String> properties = new HashMap<>();
ITouchpointType touchpointType = null;
IUpdateDescriptor updateDescriptor = null;
Version version = null;
@@ -286,13 +286,13 @@ public class SPIMetadataRepositoryTest extends AbstractProvisioningTest {
}
@Override
- public Map getProperties() {
+ public Map<String, String> getProperties() {
return this.properties;
}
@Override
public String getProperty(String key) {
- return (String) this.properties.get(key);
+ return this.properties.get(key);
}
@Override
@@ -382,11 +382,11 @@ public class SPIMetadataRepositoryTest extends AbstractProvisioningTest {
class SPITouchpointData implements ITouchpointData {
- Map instructions = new HashMap();
+ Map<String, ITouchpointInstruction> instructions = new HashMap<>();
@Override
public ITouchpointInstruction getInstruction(String instructionKey) {
- return (ITouchpointInstruction) instructions.get(instructionKey);
+ return instructions.get(instructionKey);
}
public void addInstruction(String instructionKey, ITouchpointInstruction instruction) {
@@ -394,7 +394,7 @@ public class SPIMetadataRepositoryTest extends AbstractProvisioningTest {
}
@Override
- public Map getInstructions() {
+ public Map<String, ITouchpointInstruction> getInstructions() {
return this.instructions;
}
@@ -695,7 +695,7 @@ public class SPIMetadataRepositoryTest extends AbstractProvisioningTest {
*/
public void testSPIMetadataIU() throws ProvisionException {
IMetadataRepositoryManager manager = getMetadataRepositoryManager();
- Map properties = new HashMap();
+ Map<String, String> properties = new HashMap<>();
properties.put(IRepository.PROP_COMPRESSED, "true");
IMetadataRepository repo = manager.createRepository(repoLocation.toURI(), "TestRepo", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
@@ -724,7 +724,7 @@ public class SPIMetadataRepositoryTest extends AbstractProvisioningTest {
*/
public void testProvidedCapabilitywithSPI_IU() throws ProvisionException {
IMetadataRepositoryManager manager = getMetadataRepositoryManager();
- Map properties = new HashMap();
+ Map<String, String> properties = new HashMap<>();
properties.put(IRepository.PROP_COMPRESSED, "true");
IMetadataRepository repo = manager.createRepository(repoLocation.toURI(), "TestRepo", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
@@ -763,7 +763,7 @@ public class SPIMetadataRepositoryTest extends AbstractProvisioningTest {
*/
public void testSPIRequiredCapability() throws ProvisionException {
IMetadataRepositoryManager manager = getMetadataRepositoryManager();
- Map properties = new HashMap();
+ Map<String, String> properties = new HashMap<>();
properties.put(IRepository.PROP_COMPRESSED, "true");
IMetadataRepository repo = manager.createRepository(repoLocation.toURI(), "TestRepo", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
@@ -771,7 +771,7 @@ public class SPIMetadataRepositoryTest extends AbstractProvisioningTest {
iuDescription.setId("foo");
iuDescription.setVersion(Version.createOSGi(1, 1, 1));
IRequiredCapability spiRequiredCapability = new SPIRequiredCapability("com.example", "bar", new VersionRange(Version.createOSGi(1, 0, 0), true, Version.createOSGi(2, 0, 0), true));
- Collection list = new ArrayList();
+ Collection<IRequirement> list = new ArrayList<>();
list.add(spiRequiredCapability);
iuDescription.addRequirements(list);
@@ -803,7 +803,7 @@ public class SPIMetadataRepositoryTest extends AbstractProvisioningTest {
*/
public void testSPIEquals() throws ProvisionException, URISyntaxException {
IMetadataRepositoryManager manager = getMetadataRepositoryManager();
- Map properties = new HashMap();
+ Map<String, String> properties = new HashMap<>();
properties.put(IRepository.PROP_COMPRESSED, "true");
IMetadataRepository repo = manager.createRepository(repoLocation.toURI(), "TestRepo", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
@@ -832,7 +832,7 @@ public class SPIMetadataRepositoryTest extends AbstractProvisioningTest {
SPITouchpointType spiTouchpointType = new SPITouchpointType("foo", Version.createOSGi(3, 3, 3));
iuDescription.setTouchpointType(spiTouchpointType);
- Collection requiredCapabilityList = new ArrayList();
+ Collection<IRequirement> requiredCapabilityList = new ArrayList<>();
requiredCapabilityList.add(spiRequiredCapability);
iuDescription.addRequirements(requiredCapabilityList);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java
index a8c379c45..fa8016b36 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java
@@ -1171,7 +1171,7 @@ public class ArtifactMirrorApplicationTest extends AbstractProvisioningTest {
public boolean firstAttempt = true;
IArtifactRepository source;
- public TestRetryArtifactRepository(String repositoryName, URI location, URI srcLocation, Map properties, IArtifactRepositoryManager manager) {
+ public TestRetryArtifactRepository(String repositoryName, URI location, URI srcLocation, Map<String, String> properties, IArtifactRepositoryManager manager) {
super(getAgent(), repositoryName, location, properties);
//initialize
@@ -1209,7 +1209,7 @@ public class ArtifactMirrorApplicationTest extends AbstractProvisioningTest {
}
@Override
- public synchronized IQueryResult query(IQuery query, IProgressMonitor monitor) {
+ public synchronized IQueryResult<IArtifactKey> query(IQuery<IArtifactKey> query, IProgressMonitor monitor) {
return source.query(query, monitor);
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationArtifactTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationArtifactTest.java
index 0188649f5..4c68be015 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationArtifactTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationArtifactTest.java
@@ -807,7 +807,7 @@ public class NewMirrorApplicationArtifactTest extends AbstractProvisioningTest {
public void testExistingArtifactRepoProperties() {
//Setup: create the destination
String name = "Destination Name";
- Map properties = null; //default properties
+ Map<String, String> properties = null; //default properties
try {
//create the repository and get the resulting properties
properties = getArtifactRepositoryManager().createRepository(destRepoLocation.toURI(), name, IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties).getProperties();
@@ -930,16 +930,16 @@ public class NewMirrorApplicationArtifactTest extends AbstractProvisioningTest {
fail("");
}
- IQueryResult keys = packedRepo.query(ArtifactKeyQuery.ALL_KEYS, null);
- for (Iterator iterator = keys.iterator(); iterator.hasNext();) {
- IArtifactKey key = (IArtifactKey) iterator.next();
+ IQueryResult<IArtifactKey> keys = packedRepo.query(ArtifactKeyQuery.ALL_KEYS, null);
+ for (Iterator<IArtifactKey> iterator = keys.iterator(); iterator.hasNext();) {
+ IArtifactKey key = iterator.next();
IArtifactDescriptor[] srcDescriptors = packedRepo.getArtifactDescriptors(key);
for (int j = 0; j < srcDescriptors.length; j++) {
if (!(srcDescriptors[j].getProperty(IArtifactDescriptor.FORMAT) == null) && srcDescriptors[j].getProperty(IArtifactDescriptor.FORMAT).equals(IArtifactDescriptor.FORMAT_PACKED)) {
//if we have a packed artifact
IArtifactDescriptor newDescriptor = new ArtifactDescriptor(key);
- Map properties = new OrderedProperties();
+ Map<String, String> properties = new OrderedProperties();
properties.putAll(srcDescriptors[j].getProperties());
properties.remove(IArtifactDescriptor.FORMAT);
((ArtifactDescriptor) newDescriptor).addProperties(properties);
@@ -1049,7 +1049,7 @@ public class NewMirrorApplicationArtifactTest extends AbstractProvisioningTest {
//Setup: create the destination
try {
String name = "Destination Name " + destRepoLocation;
- Map property = new HashMap();
+ Map<String, String> property = new HashMap<>();
property.put(IRepository.PROP_COMPRESSED, "true");
getArtifactRepositoryManager().createRepository(destRepoLocation.toURI(), name, IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, property);
} catch (ProvisionException e) {
@@ -1281,7 +1281,7 @@ public class NewMirrorApplicationArtifactTest extends AbstractProvisioningTest {
public boolean firstAttempt = true;
IArtifactRepository source;
- public TestRetryArtifactRepository(String repositoryName, URI location, URI srcLocation, Map properties, IArtifactRepositoryManager manager) {
+ public TestRetryArtifactRepository(String repositoryName, URI location, URI srcLocation, Map<String, String> properties, IArtifactRepositoryManager manager) {
super(getAgent(), repositoryName, location, properties);
//initialize
@@ -1319,7 +1319,7 @@ public class NewMirrorApplicationArtifactTest extends AbstractProvisioningTest {
}
@Override
- public synchronized IQueryResult query(IQuery query, IProgressMonitor monitor) {
+ public synchronized IQueryResult<IArtifactKey> query(IQuery<IArtifactKey> query, IProgressMonitor monitor) {
return source.query(query, monitor);
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/MetadataRepositoryPerformanceTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/MetadataRepositoryPerformanceTest.java
index 72d9994d8..0ae7fa5a5 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/MetadataRepositoryPerformanceTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/MetadataRepositoryPerformanceTest.java
@@ -49,11 +49,11 @@ public class MetadataRepositoryPerformanceTest extends ProvisioningPerformanceTe
public void testQueryLocalRepository() {
final int IU_COUNT = 3000;
new PerformanceTestRunner() {
- IQuery[] queries = new IQuery[IU_COUNT];
+ IQuery<IInstallableUnit>[] queries = new IQuery[IU_COUNT];
@Override
protected void setUp() {
- List<IInstallableUnit> ius = new ArrayList(IU_COUNT);
+ List<IInstallableUnit> ius = new ArrayList<>(IU_COUNT);
for (int i = 0; i < IU_COUNT; i++) {
IInstallableUnit iu = generateIU(i);
queries[i] = QueryUtil.createIUQuery(iu.getId(), iu.getVersion());
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/PublisherPerformanceTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/PublisherPerformanceTest.java
index 6f61a75ce..a28f27c00 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/PublisherPerformanceTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/perf/PublisherPerformanceTest.java
@@ -26,7 +26,7 @@ public class PublisherPerformanceTest extends ProvisioningPerformanceTest {
public void testQueryPublisherResult() {
final int IU_COUNT = 3000;
new PerformanceTestRunner() {
- IQuery[] queries = new IQuery[IU_COUNT];
+ IQuery<IInstallableUnit>[] queries = new IQuery[IU_COUNT];
PublisherResult result;
@Override
@@ -56,7 +56,7 @@ public class PublisherPerformanceTest extends ProvisioningPerformanceTest {
public void testLimitQueryPublisherResult() {
final int IU_COUNT = 3000;
new PerformanceTestRunner() {
- IQuery[] queries = new IQuery[IU_COUNT];
+ IQuery<IInstallableUnit>[] queries = new IQuery[IU_COUNT];
PublisherResult result;
@Override
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 29776048d..28189d0bc 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
@@ -58,11 +58,11 @@ public class NegationTesting extends AbstractProvisioningTest {
iud1.setVersion(Version.create("1.0.0"));
RequiredCapability req1 = new RequiredCapability(NS, N, new VersionRange("[1.1.0, 1.2.0)"), null, 0, 0, false, null);
RequiredCapability req2 = new RequiredCapability(NS, N, new VersionRange("[1.0.0, 2.0.0)"), null, false, false);
- Collection requirements = new ArrayList();
+ Collection<IRequirement> requirements = new ArrayList<>();
requirements.add(req1);
requirements.add(req2);
iud1.addRequirements(requirements);
- Collection capabilities = new ArrayList();
+ Collection<IProvidedCapability> capabilities = new ArrayList<>();
capabilities.add(new ProvidedCapability(IInstallableUnit.NAMESPACE_IU_ID, "TestNegation4", Version.create("1.0.0")));
iud1.addProvidedCapabilities(capabilities);
IInstallableUnit iu1 = MetadataFactory.createInstallableUnit(iud1);
@@ -70,7 +70,7 @@ public class NegationTesting extends AbstractProvisioningTest {
MetadataFactory.InstallableUnitDescription iud2 = new MetadataFactory.InstallableUnitDescription();
iud2.setId("ProviderOf1");
iud2.setVersion(Version.create("1.0.0"));
- Collection capabilities2 = new ArrayList();
+ Collection<IProvidedCapability> capabilities2 = new ArrayList<>();
capabilities2.add(MetadataFactory.createProvidedCapability(NS, N, Version.create("1.0.0")));
iud2.addProvidedCapabilities(capabilities2);
IInstallableUnit iu2 = MetadataFactory.createInstallableUnit(iud2);
@@ -78,7 +78,7 @@ public class NegationTesting extends AbstractProvisioningTest {
MetadataFactory.InstallableUnitDescription iud3 = new MetadataFactory.InstallableUnitDescription();
iud3.setId("ProviderOf1_1_1");
iud3.setVersion(Version.create("1.0.0"));
- Collection capabilities3 = new ArrayList();
+ Collection<IProvidedCapability> capabilities3 = new ArrayList<>();
capabilities3.add(MetadataFactory.createProvidedCapability(NS, N, Version.create("1.1.1")));
capabilities3.add(new ProvidedCapability(IInstallableUnit.NAMESPACE_IU_ID, "ProviderOf1_1_1", Version.create("1.0.0")));
iud3.addProvidedCapabilities(capabilities3);
@@ -88,7 +88,7 @@ public class NegationTesting extends AbstractProvisioningTest {
// 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, Collections.<String, String> emptyMap(), false);
- IQueryable slice = slicer.slice(new IInstallableUnit[] {iu1}, new NullProgressMonitor());
+ IQueryable<IInstallableUnit> slice = slicer.slice(new IInstallableUnit[] {iu1}, new NullProgressMonitor());
assertEquals(3, queryResultSize(slice.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())));
//Verify that the resolution succeeds and does not return iu3 since it is excluded by the requirement of iu1
@@ -116,11 +116,11 @@ public class NegationTesting extends AbstractProvisioningTest {
iud1.setVersion(Version.create("1.0.0"));
RequiredCapability req1 = new RequiredCapability(NS, N, new VersionRange("[1.1.0, 1.2.0)"), null, 0, 0, false, null);
RequiredCapability req2 = new RequiredCapability(NS, N, new VersionRange("[1.0.0, 1.1.0)"), null, false, false);
- Collection requirements = new ArrayList();
+ Collection<IRequirement> requirements = new ArrayList<>();
requirements.add(req1);
requirements.add(req2);
iud1.addRequirements(requirements);
- Collection capabilities = new ArrayList();
+ Collection<IProvidedCapability> capabilities = new ArrayList<>();
capabilities.add(new ProvidedCapability(IInstallableUnit.NAMESPACE_IU_ID, "TestNegation4", Version.create("1.0.0")));
iud1.addProvidedCapabilities(capabilities);
IInstallableUnit iu1 = MetadataFactory.createInstallableUnit(iud1);
@@ -128,7 +128,7 @@ public class NegationTesting extends AbstractProvisioningTest {
MetadataFactory.InstallableUnitDescription iud2 = new MetadataFactory.InstallableUnitDescription();
iud2.setId("ProviderOf1");
iud2.setVersion(Version.create("1.0.0"));
- Collection capabilities2 = new ArrayList();
+ Collection<IProvidedCapability> capabilities2 = new ArrayList<>();
capabilities2.add(MetadataFactory.createProvidedCapability(NS, N, Version.create("1.0.0")));
iud2.addProvidedCapabilities(capabilities2);
IInstallableUnit iu2 = MetadataFactory.createInstallableUnit(iud2);
@@ -136,7 +136,7 @@ public class NegationTesting extends AbstractProvisioningTest {
MetadataFactory.InstallableUnitDescription iud3 = new MetadataFactory.InstallableUnitDescription();
iud3.setId("ProviderOf1_1_1");
iud3.setVersion(Version.create("1.0.0"));
- Collection capabilities3 = new ArrayList();
+ Collection<IProvidedCapability> capabilities3 = new ArrayList<>();
capabilities3.add(MetadataFactory.createProvidedCapability(NS, N, Version.create("1.1.1")));
capabilities3.add(new ProvidedCapability(IInstallableUnit.NAMESPACE_IU_ID, "ProviderOf1_1_1", Version.create("1.0.0")));
iud3.addProvidedCapabilities(capabilities3);
@@ -146,7 +146,7 @@ public class NegationTesting extends AbstractProvisioningTest {
//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, Collections.<String, String> emptyMap(), false);
- IQueryable slice = slicer.slice(new IInstallableUnit[] {iu1}, new NullProgressMonitor());
+ IQueryable<IInstallableUnit> 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())));
}
@@ -157,11 +157,11 @@ public class NegationTesting extends AbstractProvisioningTest {
iud1.setVersion(Version.create("1.0.0"));
RequiredCapability req1 = new RequiredCapability(NS, N, new VersionRange("[1.1.0, 1.2.0)"), null, 0, 0, false, null);
RequiredCapability req2 = new RequiredCapability(NS, N, new VersionRange("[1.0.0, 1.1.0)"), null, false, false);
- Collection requirements = new ArrayList();
+ Collection<IRequirement> requirements = new ArrayList<>();
requirements.add(req1);
requirements.add(req2);
iud1.addRequirements(requirements);
- Collection capabilities = new ArrayList();
+ Collection<IProvidedCapability> capabilities = new ArrayList<>();
capabilities.add(new ProvidedCapability(IInstallableUnit.NAMESPACE_IU_ID, "TestNegation4", Version.create("1.0.0")));
iud1.addProvidedCapabilities(capabilities);
IInstallableUnit iu1 = MetadataFactory.createInstallableUnit(iud1);
@@ -169,7 +169,7 @@ public class NegationTesting extends AbstractProvisioningTest {
MetadataFactory.InstallableUnitDescription iud2 = new MetadataFactory.InstallableUnitDescription();
iud2.setId("ProviderOf1");
iud2.setVersion(Version.create("1.0.0"));
- Collection capabilities2 = new ArrayList();
+ Collection<IProvidedCapability> capabilities2 = new ArrayList<>();
capabilities2.add(MetadataFactory.createProvidedCapability(NS, N, Version.create("1.0.0")));
iud2.addProvidedCapabilities(capabilities2);
IInstallableUnit iu2 = MetadataFactory.createInstallableUnit(iud2);
@@ -178,7 +178,7 @@ public class NegationTesting extends AbstractProvisioningTest {
//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, Collections.<String, String> emptyMap(), false);
- IQueryable slice = slicer.slice(new IInstallableUnit[] {iu1}, new NullProgressMonitor());
+ IQueryable<IInstallableUnit> 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())));
@@ -199,11 +199,11 @@ public class NegationTesting extends AbstractProvisioningTest {
iud1.setVersion(Version.create("1.0.0"));
RequiredCapability req1 = new RequiredCapability(NS, N, new VersionRange("[1.1.0, 1.2.0)"), null, 0, 0, false, null);
RequiredCapability req2 = new RequiredCapability(NS, N, new VersionRange("[1.0.0, 2.0.0)"), null, false, false);
- Collection requirements = new ArrayList();
+ Collection<IRequirement> requirements = new ArrayList<>();
requirements.add(req1);
requirements.add(req2);
iud1.addRequirements(requirements);
- Collection capabilities = new ArrayList();
+ Collection<IProvidedCapability> capabilities = new ArrayList<>();
capabilities.add(new ProvidedCapability(IInstallableUnit.NAMESPACE_IU_ID, "TestNegation4", Version.create("1.0.0")));
iud1.addProvidedCapabilities(capabilities);
IInstallableUnit iu1 = MetadataFactory.createInstallableUnit(iud1);
@@ -211,7 +211,7 @@ public class NegationTesting extends AbstractProvisioningTest {
MetadataFactory.InstallableUnitDescription iud2 = new MetadataFactory.InstallableUnitDescription();
iud2.setId("ProviderOf1");
iud2.setVersion(Version.create("1.0.0"));
- Collection capabilities2 = new ArrayList();
+ Collection<IProvidedCapability> capabilities2 = new ArrayList<>();
capabilities2.add(MetadataFactory.createProvidedCapability(NS, N, Version.create("1.0.0")));
iud2.addProvidedCapabilities(capabilities2);
IInstallableUnit iu2 = MetadataFactory.createInstallableUnit(iud2);
@@ -219,11 +219,11 @@ public class NegationTesting extends AbstractProvisioningTest {
MetadataFactory.InstallableUnitDescription iud3 = new MetadataFactory.InstallableUnitDescription();
iud3.setId("ProviderOf1_1_1");
iud3.setVersion(Version.create("1.0.0"));
- Collection capabilities3 = new ArrayList();
+ Collection<IProvidedCapability> capabilities3 = new ArrayList<>();
capabilities3.add(MetadataFactory.createProvidedCapability(NS, N, Version.create("1.1.1")));
capabilities3.add(new ProvidedCapability(IInstallableUnit.NAMESPACE_IU_ID, "ProviderOf1_1_1", Version.create("1.0.0")));
iud3.addProvidedCapabilities(capabilities3);
- Collection requirements3 = new ArrayList();
+ Collection<IRequirement> requirements3 = new ArrayList<>();
requirements3.add(MetadataFactory.createRequirement("DOES-NOT-EXIST", "NEVER", new VersionRange("[1.0.0, 2.0.0)"), null, false, false));
iud3.addRequirements(requirements3);
IInstallableUnit iu3 = MetadataFactory.createInstallableUnit(iud3);
@@ -232,7 +232,7 @@ public class NegationTesting extends AbstractProvisioningTest {
// 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, Collections.<String, String> emptyMap(), false);
- IQueryable slice = slicer.slice(new IInstallableUnit[] {iu1}, new NullProgressMonitor());
+ IQueryable<IInstallableUnit> slice = slicer.slice(new IInstallableUnit[] {iu1}, new NullProgressMonitor());
assertEquals(3, queryResultSize(slice.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())));
//Verify that the resolution succeeds and does not return iu3 since it is excluded by the requirement of iu1
@@ -260,11 +260,11 @@ public class NegationTesting extends AbstractProvisioningTest {
iud1.setVersion(Version.create("1.0.0"));
RequiredCapability req1 = new RequiredCapability(NS, N, new VersionRange("[1.1.0, 1.2.0)"), null, 0, 0, false, null);
RequiredCapability req2 = new RequiredCapability(NS, N, new VersionRange("[1.0.0, 2.0.0)"), null, false, false);
- Collection requirements = new ArrayList();
+ Collection<IRequirement> requirements = new ArrayList<>();
requirements.add(req1);
requirements.add(req2);
iud1.addRequirements(requirements);
- Collection capabilities = new ArrayList();
+ Collection<IProvidedCapability> capabilities = new ArrayList<>();
capabilities.add(new ProvidedCapability(IInstallableUnit.NAMESPACE_IU_ID, "TestNegation4", Version.create("1.0.0")));
iud1.addProvidedCapabilities(capabilities);
IInstallableUnit iu1 = MetadataFactory.createInstallableUnit(iud1);
@@ -272,7 +272,7 @@ public class NegationTesting extends AbstractProvisioningTest {
MetadataFactory.InstallableUnitDescription iud2 = new MetadataFactory.InstallableUnitDescription();
iud2.setId("ProviderOf1");
iud2.setVersion(Version.create("1.0.0"));
- Collection capabilities2 = new ArrayList();
+ Collection<IProvidedCapability> capabilities2 = new ArrayList<>();
capabilities2.add(MetadataFactory.createProvidedCapability(NS, N, Version.create("1.0.0")));
iud2.addProvidedCapabilities(capabilities2);
IInstallableUnit iu2 = MetadataFactory.createInstallableUnit(iud2);
@@ -280,7 +280,7 @@ public class NegationTesting extends AbstractProvisioningTest {
MetadataFactory.InstallableUnitDescription iud3 = new MetadataFactory.InstallableUnitDescription();
iud3.setId("ProviderOf1_1_1");
iud3.setVersion(Version.create("1.0.0"));
- Collection capabilities3 = new ArrayList();
+ Collection<IProvidedCapability> capabilities3 = new ArrayList<>();
capabilities3.add(MetadataFactory.createProvidedCapability(NS, N, Version.create("1.1.1")));
capabilities3.add(new ProvidedCapability(IInstallableUnit.NAMESPACE_IU_ID, "ProviderOf1_1_1", Version.create("1.0.0")));
iud3.addProvidedCapabilities(capabilities3);
@@ -289,10 +289,10 @@ public class NegationTesting extends AbstractProvisioningTest {
MetadataFactory.InstallableUnitDescription iud4 = new MetadataFactory.InstallableUnitDescription();
iud4.setId("AnotherRoot");
iud4.setVersion(Version.create("1.0.0"));
- Collection capabilities4 = new ArrayList();
+ Collection<IProvidedCapability> capabilities4 = new ArrayList<>();
capabilities4.add(new ProvidedCapability(IInstallableUnit.NAMESPACE_IU_ID, "AnotherRoot", Version.create("1.0.0")));
iud4.addProvidedCapabilities(capabilities4);
- Collection reqs4 = new ArrayList();
+ Collection<IRequirement> reqs4 = new ArrayList<>();
reqs4.add(new RequiredCapability(NS, N, new VersionRange("[1.1.1, 1.1.1]"), null, false, false));
iud4.addRequirements(reqs4);
IInstallableUnit iu4 = MetadataFactory.createInstallableUnit(iud4);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/TestArtifactRepository.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/TestArtifactRepository.java
index a06ffe7a9..ba72aa144 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/TestArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/TestArtifactRepository.java
@@ -357,7 +357,7 @@ public class TestArtifactRepository implements IArtifactRepository {
}
@Override
- public Object getAdapter(Class adapter) {
+ public <T> T getAdapter(Class<T> adapter) {
return null;
}
@@ -411,13 +411,7 @@ public class TestArtifactRepository implements IArtifactRepository {
@Override
public IQueryable<IArtifactDescriptor> descriptorQueryable() {
final Collection<IArtifactDescriptor> descs = repo.keySet();
- return new IQueryable<IArtifactDescriptor>() {
-
- @Override
- public IQueryResult<IArtifactDescriptor> query(IQuery<IArtifactDescriptor> query, IProgressMonitor monitor) {
- return query.perform(descs.iterator());
- }
- };
+ return (query, monitor) -> query.perform(descs.iterator());
}
@Override
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AdviceMatcher.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AdviceMatcher.java
index 636163acd..f40ea8c63 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AdviceMatcher.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/AdviceMatcher.java
@@ -21,9 +21,9 @@ import org.eclipse.equinox.p2.publisher.IPublisherAdvice;
public class AdviceMatcher implements IArgumentMatcher {
private final Version version;
private final String id;
- private static Class clazz;
+ private static Class<?> clazz;
- public static IPublisherAdvice adviceMatches(String id, Version version, Class clazz) {
+ public static IPublisherAdvice adviceMatches(String id, Version version, Class<?> clazz) {
AdviceMatcher.clazz = clazz;
EasyMock.reportMatcher(new AdviceMatcher(id, version));
return null;
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/LocalUpdateSiteActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/LocalUpdateSiteActionTest.java
index f87581dd2..6f0bd8f83 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/LocalUpdateSiteActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/LocalUpdateSiteActionTest.java
@@ -48,15 +48,15 @@ public class LocalUpdateSiteActionTest extends ActionTest {
File file = TestData.getFile("updatesite/site", "");
LocalUpdateSiteAction action = new LocalUpdateSiteAction(file.getAbsolutePath(), "qualifier");
action.perform(publisherInfo, publisherResult, new NullProgressMonitor());
- Collection ius = publisherResult.getIUs("test.feature.feature.jar", null);
+ Collection<IInstallableUnit> ius = publisherResult.getIUs("test.feature.feature.jar", null);
assertEquals("1.0", 1, ius.size());
- IInstallableUnit iu = (IInstallableUnit) ius.iterator().next();
+ IInstallableUnit iu = ius.iterator().next();
Collection<ITouchpointData> touchpointData = iu.getTouchpointData();
assertEquals("1.1", 1, touchpointData.size());
- Map instructions = touchpointData.iterator().next().getInstructions();
- Set keys = instructions.keySet();
+ Map<String, ITouchpointInstruction> instructions = touchpointData.iterator().next().getInstructions();
+ Set<String> keys = instructions.keySet();
assertEquals("1.2", 1, keys.size());
- String unzip = (String) keys.iterator().next();
+ String unzip = keys.iterator().next();
assertEquals("1.3", "zipped", unzip);
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/MultiCapture.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/MultiCapture.java
index e1e248700..92c5e1e27 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/MultiCapture.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/MultiCapture.java
@@ -18,7 +18,7 @@ import org.easymock.Capture;
*/
public class MultiCapture<T> extends Capture<T> implements Collection<T> {
private static final long serialVersionUID = 1L;
- private final List captured = new ArrayList();
+ private final List<T> captured = new ArrayList<>();
@Override
public boolean add(T arg0) {
@@ -26,7 +26,7 @@ public class MultiCapture<T> extends Capture<T> implements Collection<T> {
}
@Override
- public boolean addAll(Collection arg0) {
+ public boolean addAll(Collection<? extends T> arg0) {
return captured.addAll(arg0);
}
@@ -41,7 +41,7 @@ public class MultiCapture<T> extends Capture<T> implements Collection<T> {
}
@Override
- public boolean containsAll(Collection arg0) {
+ public boolean containsAll(Collection<?> arg0) {
return captured.containsAll(arg0);
}
@@ -51,7 +51,7 @@ public class MultiCapture<T> extends Capture<T> implements Collection<T> {
}
@Override
- public Iterator iterator() {
+ public Iterator<T> iterator() {
return captured.iterator();
}
@@ -61,12 +61,12 @@ public class MultiCapture<T> extends Capture<T> implements Collection<T> {
}
@Override
- public boolean removeAll(Collection arg0) {
+ public boolean removeAll(Collection<?> arg0) {
return captured.removeAll(arg0);
}
@Override
- public boolean retainAll(Collection arg0) {
+ public boolean retainAll(Collection<?> arg0) {
return captured.retainAll(arg0);
}
@@ -87,7 +87,7 @@ public class MultiCapture<T> extends Capture<T> implements Collection<T> {
}
@Override
- public Object[] toArray(Object[] arg0) {
+ public <T> T[] toArray(T[] arg0) {
return captured.toArray(arg0);
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootFilesActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootFilesActionTest.java
index cea0a2c72..d576b2e49 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootFilesActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootFilesActionTest.java
@@ -71,7 +71,7 @@ public class RootFilesActionTest extends ActionTest {
private void setupTestCase(int testArg) throws Exception {
this.testArg = testArg;
- adviceCollection = new ArrayList();
+ adviceCollection = new ArrayList<>();
topLevel = AbstractPublisherAction.getArrayFromString(topArg, COMMA_SEPARATOR);
if ((testArg & ARTIFACT_REPO) > 0)
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootIUActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootIUActionTest.java
index 392e484b2..b3e22f08c 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootIUActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootIUActionTest.java
@@ -70,7 +70,7 @@ public class RootIUActionTest extends ActionTest {
debug("\n**********************************"); //$NON-NLS-1$
debug(" advice (as iu) A"); //$NON-NLS-1$
setupAdvice(EMPTY);
- Collection iuCollection = new ArrayList();
+ Collection<Object> iuCollection = new ArrayList<>();
iuCollection.add(mockIU(iu_A, null));
rootIUAdviceCollection.add(new RootIUAdvice(iuCollection));
setupMetadataRepository(CONTAINS_A);
@@ -225,36 +225,34 @@ public class RootIUActionTest extends ActionTest {
}
private void setupFilterAdvice(int testSpec) {
- IQuery query = null;
- rootIUAdviceCollection = new ArrayList();
+ IQuery<IInstallableUnit> query = null;
+ rootIUAdviceCollection = new ArrayList<>();
if ((testSpec & CONTAINS_A) > 0) {
- query = new MatchQuery() {
+ query = new MatchQuery<IInstallableUnit>() {
@Override
- public boolean isMatch(Object candidate) {
- if (candidate instanceof IInstallableUnit)
- if (((IInstallableUnit) candidate).getId().equals(iu_A))
- return true;
+ public boolean isMatch(IInstallableUnit candidate) {
+ if (candidate.getId().equals(iu_A))
+ return true;
return false;
}
};
rootIUAdviceCollection.add(new RootIUResultFilterAdvice(query));
}
if ((testSpec & CONTAINS_B) > 0) {
- query = new MatchQuery() {
+ query = new MatchQuery<IInstallableUnit>() {
@Override
- public boolean isMatch(Object candidate) {
- if (candidate instanceof IInstallableUnit)
- if (((IInstallableUnit) candidate).getId().equals(iu_B))
- return true;
+ public boolean isMatch(IInstallableUnit candidate) {
+ if (candidate.getId().equals(iu_B))
+ return true;
return false;
}
};
rootIUAdviceCollection.add(new RootIUResultFilterAdvice(query));
}
if ((testSpec & EMPTY) > 0) {
- query = new MatchQuery() {
+ query = new MatchQuery<IInstallableUnit>() {
@Override
- public boolean isMatch(Object candidate) {
+ public boolean isMatch(IInstallableUnit candidate) {
return false;
}
};
@@ -265,9 +263,9 @@ public class RootIUActionTest extends ActionTest {
private void confirmResultRequired(int testSpec) {
// checks that the results has a non root iu with required
// capabilities from the publisher result
- ArrayList ius = new ArrayList(publisherResult.getIUs(rootIU, IPublisherResult.NON_ROOT));
+ ArrayList<IInstallableUnit> ius = new ArrayList<>(publisherResult.getIUs(rootIU, IPublisherResult.NON_ROOT));
assertTrue(ius.size() == 1);
- IInstallableUnit iu = (IInstallableUnit) ius.get(0);
+ IInstallableUnit iu = ius.get(0);
assertTrue(iu != null);
assertTrue(iu.getVersion().equals(versionArg));
Collection<IRequirement> required = iu.getRequirements();
@@ -297,7 +295,7 @@ public class RootIUActionTest extends ActionTest {
}
private boolean contains(Collection<IRequirement> required, String iu) {
- for (Iterator iterator = required.iterator(); iterator.hasNext();) {
+ for (Iterator<IRequirement> iterator = required.iterator(); iterator.hasNext();) {
IRequiredCapability req = (IRequiredCapability) iterator.next();
if (req.getName().equalsIgnoreCase(iu))
return true;
@@ -307,7 +305,7 @@ public class RootIUActionTest extends ActionTest {
public void setupPublisherResult(int testSpec) {
super.setupPublisherResult();
- Collection ius = new ArrayList();
+ Collection<IInstallableUnit> ius = new ArrayList<>();
if ((testSpec & CONTAINS_A) > 0) {
ius.add(mockIU(iu_A, null));
}
@@ -318,7 +316,7 @@ public class RootIUActionTest extends ActionTest {
}
private void setupMetadataRepository(int testSpec) {
- ArrayList repoContents = new ArrayList();
+ ArrayList<IInstallableUnit> repoContents = new ArrayList<>();
if ((testSpec & CONTAINS_A) > 0) {
repoContents.add(mockIU(iu_A, null));
}
@@ -326,30 +324,30 @@ public class RootIUActionTest extends ActionTest {
repoContents.add(mockIU(iu_B, null));
}
- IInstallableUnit[] ius = (IInstallableUnit[]) repoContents.toArray(new IInstallableUnit[repoContents.size()]);
+ IInstallableUnit[] ius = repoContents.toArray(new IInstallableUnit[repoContents.size()]);
metadataRepository = new TestMetadataRepository(getAgent(), ius);
}
public void setupAdvice(int testSpec) {
- Collection publishIUs = new ArrayList();
+ Collection<Object> publishIUs = new ArrayList<>();
if ((testSpec & CONTAINS_A) > 0)
publishIUs.add(iu_A);
if ((testSpec & CONTAINS_B) > 0)
publishIUs.add(iu_B);
- rootIUAdviceCollection = new ArrayList();
+ rootIUAdviceCollection = new ArrayList<>();
rootIUAdviceCollection.add(new RootIUAdvice(publishIUs));
}
@Override
public void insertPublisherInfoBehavior() {
- expect(publisherInfo.getAdvice(null, false, rootIU, versionArg, ICapabilityAdvice.class)).andReturn(new ArrayList()).anyTimes();
+ expect(publisherInfo.getAdvice(null, false, rootIU, versionArg, ICapabilityAdvice.class)).andReturn(new ArrayList<>()).anyTimes();
expect(publisherInfo.getAdvice(null, true, null, null, IRootIUAdvice.class)).andReturn(rootIUAdviceCollection).anyTimes();
expect(publisherInfo.getAdvice(null, true, null, null, IVersionAdvice.class)).andReturn(null).anyTimes();
- expect(publisherInfo.getAdvice(null, false, rootIU, versionArg, ITouchpointAdvice.class)).andReturn(new ArrayList()).anyTimes();
- expect(publisherInfo.getAdvice(null, false, rootIU, versionArg, IUpdateDescriptorAdvice.class)).andReturn(new ArrayList()).anyTimes();
- expect(publisherInfo.getAdvice(null, false, rootIU, versionArg, IPropertyAdvice.class)).andReturn(new ArrayList()).anyTimes();
- expect(publisherInfo.getAdvice(null, false, rootIU, versionArg, IAdditionalInstallableUnitAdvice.class)).andReturn(new ArrayList()).anyTimes();
- expect(publisherInfo.getAdvice(null, true, rootIU, versionArg, ILicenseAdvice.class)).andReturn(new ArrayList()).anyTimes();
+ expect(publisherInfo.getAdvice(null, false, rootIU, versionArg, ITouchpointAdvice.class)).andReturn(new ArrayList<>()).anyTimes();
+ expect(publisherInfo.getAdvice(null, false, rootIU, versionArg, IUpdateDescriptorAdvice.class)).andReturn(new ArrayList<>()).anyTimes();
+ expect(publisherInfo.getAdvice(null, false, rootIU, versionArg, IPropertyAdvice.class)).andReturn(new ArrayList<>()).anyTimes();
+ expect(publisherInfo.getAdvice(null, false, rootIU, versionArg, IAdditionalInstallableUnitAdvice.class)).andReturn(new ArrayList<>()).anyTimes();
+ expect(publisherInfo.getAdvice(null, true, rootIU, versionArg, ILicenseAdvice.class)).andReturn(new ArrayList<>()).anyTimes();
expect(publisherInfo.getMetadataRepository()).andReturn(metadataRepository).anyTimes();
expect(publisherInfo.getContextMetadataRepository()).andReturn(null).anyTimes();
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/TestQueryReimplementation.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/TestQueryReimplementation.java
index f70d87d89..ff409e6fa 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/TestQueryReimplementation.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/TestQueryReimplementation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010 Cloudsmith Inc. and others.
+ * Copyright (c) 2009, 2017 Cloudsmith Inc. 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
@@ -18,7 +18,7 @@ import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class TestQueryReimplementation extends AbstractProvisioningTest {
- public static class UpdateQuery extends ExpressionMatchQuery {
+ public static class UpdateQuery extends ExpressionMatchQuery<IInstallableUnit> {
private static final IExpression expr1;
private static final IExpression expr2;
@@ -42,7 +42,7 @@ public class TestQueryReimplementation extends AbstractProvisioningTest {
}
}
- public static class IUPropertyQuery extends ExpressionMatchQuery {
+ public static class IUPropertyQuery extends ExpressionMatchQuery<IInstallableUnit> {
private static final IExpression expr = ExpressionUtil.getParser().parse("properties[$0] == $1");
public IUPropertyQuery(String propertyName, String propertyValue) {
@@ -50,7 +50,7 @@ public class TestQueryReimplementation extends AbstractProvisioningTest {
}
}
- public static class InstallableUnitQuery extends ExpressionMatchQuery {
+ public static class InstallableUnitQuery extends ExpressionMatchQuery<IInstallableUnit> {
/**
* A convenience query that will match any {@link IInstallableUnit}
* it encounters.
@@ -69,7 +69,7 @@ public class TestQueryReimplementation extends AbstractProvisioningTest {
/**
* Creates a query that will match any {@link IInstallableUnit} with the given
* id, regardless of version.
- *
+ *
* @param id The installable unit id to match, or <code>null</code> to match any id
*/
public InstallableUnitQuery(String id) {
@@ -79,7 +79,7 @@ public class TestQueryReimplementation extends AbstractProvisioningTest {
/**
* Creates a query that will match any {@link IInstallableUnit} with the given
* id, and whose version falls in the provided range.
- *
+ *
* @param id The installable unit id to match, or <code>null</code> to match any id
* @param range The version range to match
*/
@@ -90,7 +90,7 @@ public class TestQueryReimplementation extends AbstractProvisioningTest {
/**
* Creates a query that will match any {@link IInstallableUnit} with the given
* id and version.
- *
+ *
* @param id The installable unit id to match, or <code>null</code> to match any id
* @param version The precise version that a matching unit must have
*/
@@ -101,7 +101,7 @@ public class TestQueryReimplementation extends AbstractProvisioningTest {
/**
* Creates a query that will match any {@link IInstallableUnit} with the given
* id and version.
- *
+ *
* @param versionedId The precise id/version combination that a matching unit must have
*/
public InstallableUnitQuery(IVersionedId versionedId) {
@@ -125,14 +125,14 @@ public class TestQueryReimplementation extends AbstractProvisioningTest {
public void testUpdateWithDifferentId() {
IMetadataRepository repo = createTestMetdataRepository(new IInstallableUnit[] {a1, updateOfA});
- IQueryResult c = repo.query(new UpdateQuery(a1), null);
+ IQueryResult<IInstallableUnit> c = repo.query(new UpdateQuery(a1), null);
assertEquals(1, queryResultSize(c));
assertEquals(updateOfA, c.iterator().next());
}
public void testWithSuperiorVersion() {
IMetadataRepository repo2 = createTestMetdataRepository(new IInstallableUnit[] {a11, a1});
- IQueryResult c2 = repo2.query(new UpdateQuery(a1), null);
+ IQueryResult<IInstallableUnit> c2 = repo2.query(new UpdateQuery(a1), null);
assertEquals(1, queryResultSize(c2));
assertEquals(a11, c2.iterator().next());
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/ReconcilerTestSuite.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/ReconcilerTestSuite.java
index 48e544f41..c6a1637f9 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/ReconcilerTestSuite.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/ReconcilerTestSuite.java
@@ -38,10 +38,10 @@ public class ReconcilerTestSuite extends TestSuite {
}
@Override
- public Enumeration tests() {
- Vector result = new Vector();
+ public Enumeration<Test> tests() {
+ Vector<Test> result = new Vector<>();
result.add(INITIALIZE);
- for (Enumeration e = super.tests(); e.hasMoreElements();)
+ for (Enumeration<Test> e = super.tests(); e.hasMoreElements();)
result.add(e.nextElement());
result.add(CLEANUP);
return result.elements();
@@ -77,8 +77,8 @@ public class ReconcilerTestSuite extends TestSuite {
*/
@Override
public void run(TestResult result) {
- for (Enumeration e = tests(); e.hasMoreElements();) {
- Test each = (Test) e.nextElement();
+ for (Enumeration<Test> e = tests(); e.hasMoreElements();) {
+ Test each = e.nextElement();
if (result.shouldStop())
break;
runTest(each, result);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddJVMArgumentActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddJVMArgumentActionTest.java
index 0d9924187..d43ecff46 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddJVMArgumentActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddJVMArgumentActionTest.java
@@ -23,7 +23,7 @@ public class AddJVMArgumentActionTest extends AbstractProvisioningTest {
private static File tempDir;
private LauncherData launcherData;
- private Map parameters;
+ private Map<String, Object> parameters;
public AddJVMArgumentActionTest(String name) {
super(name);
@@ -39,7 +39,7 @@ public class AddJVMArgumentActionTest extends AbstractProvisioningTest {
tempDir = new File(System.getProperty("java.io.tmpdir"), "JVMArgs");
tempDir.mkdirs();
- parameters = new HashMap();
+ parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
Properties profileProperties = new Properties();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddProgramArgumentActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddProgramArgumentActionTest.java
index bd8d4ba60..7f9a1e13a 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddProgramArgumentActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddProgramArgumentActionTest.java
@@ -40,7 +40,7 @@ public class AddProgramArgumentActionTest extends AbstractProvisioningTest {
}
public void testExecuteUndo() {
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
Properties profileProperties = new Properties();
@@ -85,7 +85,7 @@ public class AddProgramArgumentActionTest extends AbstractProvisioningTest {
IInstallableUnit iu = createBundleIU(bundleDescription, osgiTarget.isDirectory(), key);
bundlePool.addDescriptor(descriptor, new NullProgressMonitor());
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
@@ -98,7 +98,7 @@ public class AddProgramArgumentActionTest extends AbstractProvisioningTest {
assertNotNull(manipulator);
String programArg = "-somekey";
- Map keyParameters = new HashMap(parameters);
+ Map<String, Object> keyParameters = new HashMap<>(parameters);
keyParameters.put(ActionConstants.PARM_PROGRAM_ARG, programArg);
programArg = "@artifact";
@@ -138,7 +138,7 @@ public class AddProgramArgumentActionTest extends AbstractProvisioningTest {
IInstallableUnit iu = createBundleIU(bundleDescription, osgiTarget.isDirectory(), key);
bundlePool.addDescriptor(descriptor, new NullProgressMonitor());
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
@@ -152,7 +152,7 @@ public class AddProgramArgumentActionTest extends AbstractProvisioningTest {
String programArg = "-somekey";
String programArgValue = "@artifact";
- Map keyParameters = new HashMap(parameters);
+ Map<String, Object> keyParameters = new HashMap<>(parameters);
keyParameters.put(ActionConstants.PARM_PROGRAM_ARG, programArg);
keyParameters.put(ActionConstants.PARM_PROGRAM_ARG_VALUE, programArgValue);
@@ -197,7 +197,7 @@ public class AddProgramArgumentActionTest extends AbstractProvisioningTest {
IInstallableUnit iu = createBundleIU(bundleDescription, osgiTarget.isDirectory(), key);
bundlePool.addDescriptor(descriptor, new NullProgressMonitor());
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
@@ -210,7 +210,7 @@ public class AddProgramArgumentActionTest extends AbstractProvisioningTest {
assertNotNull(manipulator);
String programArg = "-somekey";
- Map keyParameters = new HashMap(parameters);
+ Map<String, Object> keyParameters = new HashMap<>(parameters);
keyParameters.put(ActionConstants.PARM_PROGRAM_ARG, programArg);
programArg = (String) parameters.get("artifact.location");
@@ -250,7 +250,7 @@ public class AddProgramArgumentActionTest extends AbstractProvisioningTest {
IInstallableUnit iu = createBundleIU(bundleDescription, osgiTarget.isDirectory(), key);
bundlePool.addDescriptor(descriptor, new NullProgressMonitor());
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
@@ -264,7 +264,7 @@ public class AddProgramArgumentActionTest extends AbstractProvisioningTest {
String programArg = "-somekey";
String programArgValue = (String) parameters.get("artifact.location");
- Map keyParameters = new HashMap(parameters);
+ Map<String, Object> keyParameters = new HashMap<>(parameters);
keyParameters.put(ActionConstants.PARM_PROGRAM_ARG, programArg);
keyParameters.put(ActionConstants.PARM_PROGRAM_ARG_VALUE, programArgValue);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddProgramPropertyActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddProgramPropertyActionTest.java
index 74a62eecc..3df900b11 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddProgramPropertyActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddProgramPropertyActionTest.java
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
+ * Copyright (c) 2011, 2017 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
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -32,7 +32,7 @@ public class AddProgramPropertyActionTest extends AbstractProvisioningTest {
public void testExecuteUndo() {
// setup
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
Properties profileProperties = new Properties();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddRepositoryActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddRepositoryActionTest.java
index 9639094aa..96d078138 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddRepositoryActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddRepositoryActionTest.java
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * Copyright (c) 2008, 2017 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
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -113,7 +113,7 @@ public class AddRepositoryActionTest extends AbstractProvisioningTest {
}
public void testNoArguments() {
- IStatus result = action.execute(new HashMap());
+ IStatus result = action.execute(new HashMap<>());
assertTrue("1.0", !result.isOK());
}
@@ -167,7 +167,7 @@ public class AddRepositoryActionTest extends AbstractProvisioningTest {
public void testFullInstall() {
String id = "AddRepositoryActionTest.testFullInstall";
Version version = Version.createOSGi(1, 0, 0);
- Map instructions = new HashMap();
+ Map<String, Object> instructions = new HashMap<>();
instructions.put("configure", TouchpointInstruction.encodeAction("addRepository", getValidArguments()));
ITouchpointData tpData = MetadataFactory.createTouchpointData(instructions);
IInstallableUnit iu = createIU(id, version, null, NO_REQUIRES, NO_PROVIDES, NO_PROPERTIES, TOUCHPOINT_OSGI, tpData, true, createUpdateDescriptor(id, version), null);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddSourceBundleActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddSourceBundleActionTest.java
index 3ec2123f3..d3e6c6034 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddSourceBundleActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddSourceBundleActionTest.java
@@ -60,7 +60,7 @@ public class AddSourceBundleActionTest extends AbstractProvisioningTest {
IInstallableUnit iu = createBundleIU(bundleDescription, osgiTarget.isDirectory(), key);
bundlePool.addDescriptor(descriptor, new NullProgressMonitor());
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/CheckTrustActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/CheckTrustActionTest.java
index 8661a7876..93c9abed9 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/CheckTrustActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/CheckTrustActionTest.java
@@ -59,10 +59,10 @@ public class CheckTrustActionTest extends AbstractProvisioningTest {
IInstallableUnit iu = createBundleIU(bundleDescription, osgiTarget.isDirectory(), key);
bundlePool.addDescriptor(descriptor, new NullProgressMonitor());
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
- parameters.put(CheckTrust.PARM_ARTIFACT_FILES, new ArrayList());
+ parameters.put(CheckTrust.PARM_ARTIFACT_FILES, new ArrayList<>());
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
touchpoint.initializePhase(null, profile, "test", parameters);
InstallableUnitOperand operand = new InstallableUnitOperand(null, iu);
@@ -70,13 +70,13 @@ public class CheckTrustActionTest extends AbstractProvisioningTest {
touchpoint.initializeOperand(profile, parameters);
parameters = Collections.unmodifiableMap(parameters);
- assertFalse(((List) parameters.get(CheckTrust.PARM_ARTIFACT_FILES)).contains(osgiTarget));
+ assertFalse(((List<?>) parameters.get(CheckTrust.PARM_ARTIFACT_FILES)).contains(osgiTarget));
CheckTrustAction action = new CheckTrustAction();
action.execute(parameters);
- assertTrue(((List) parameters.get(CheckTrust.PARM_ARTIFACT_FILES)).contains(osgiTarget));
+ assertTrue(((List<?>) parameters.get(CheckTrust.PARM_ARTIFACT_FILES)).contains(osgiTarget));
// does nothing so should not alter parameters
action.undo(parameters);
- assertTrue(((List) parameters.get(CheckTrust.PARM_ARTIFACT_FILES)).contains(osgiTarget));
+ assertTrue(((List<?>) parameters.get(CheckTrust.PARM_ARTIFACT_FILES)).contains(osgiTarget));
}
} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/CollectActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/CollectActionTest.java
index 0891119c4..d6bfdcc46 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/CollectActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/CollectActionTest.java
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * Copyright (c) 2008, 2017 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
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -59,7 +59,7 @@ public class CollectActionTest extends AbstractProvisioningTest {
IInstallableUnit iu = createBundleIU(bundleDescription, osgiTarget.isDirectory(), key);
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
parameters.put(Collect.PARM_ARTIFACT_REQUESTS, new ArrayList<IArtifactRequest[]>());
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/InstallBundleActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/InstallBundleActionTest.java
index 3b70c4c7f..3e0522c81 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/InstallBundleActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/InstallBundleActionTest.java
@@ -61,7 +61,7 @@ public class InstallBundleActionTest extends AbstractProvisioningTest {
IInstallableUnit iu = createBundleIU(bundleDescription, osgiTarget.isDirectory(), key);
bundlePool.addDescriptor(descriptor, new NullProgressMonitor());
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/InstallFeatureActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/InstallFeatureActionTest.java
index 912804f25..9e43280ea 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/InstallFeatureActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/InstallFeatureActionTest.java
@@ -66,7 +66,7 @@ public class InstallFeatureActionTest extends AbstractProvisioningTest {
bundlePool.addDescriptor(descriptor, new NullProgressMonitor());
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
@@ -119,7 +119,7 @@ public class InstallFeatureActionTest extends AbstractProvisioningTest {
bundlePool.addDescriptor(descriptor, new NullProgressMonitor());
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/JVMArgumentActionLogicTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/JVMArgumentActionLogicTest.java
index d9891a274..67d57c37e 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/JVMArgumentActionLogicTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/JVMArgumentActionLogicTest.java
@@ -24,7 +24,7 @@ import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class JVMArgumentActionLogicTest extends AbstractProvisioningTest {
private static File tempDir;
- private Map parameters;
+ private Map<String, Object> parameters;
private LauncherData launcherData;
@Override
@@ -33,7 +33,7 @@ public class JVMArgumentActionLogicTest extends AbstractProvisioningTest {
tempDir = new File(System.getProperty("java.io.tmpdir"), "JVMArgs");
tempDir.mkdirs();
- parameters = new HashMap();
+ parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
Properties profileProperties = new Properties();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/LinkActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/LinkActionTest.java
index 4a4213ac1..bb3ce772c 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/LinkActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/LinkActionTest.java
@@ -48,7 +48,7 @@ public class LinkActionTest extends AbstractProvisioningTest {
File zipTarget = new File(installFolder, "a.zip");
copy("2.0", zipSource, zipTarget);
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
@@ -89,7 +89,7 @@ public class LinkActionTest extends AbstractProvisioningTest {
IInstallableUnit iu = createBundleIU(bundleDescription, dirBundleTarget.isDirectory(), key);
bundlePool.addDescriptor(descriptor, new NullProgressMonitor());
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
@@ -134,7 +134,7 @@ public class LinkActionTest extends AbstractProvisioningTest {
IInstallableUnit iu = createBundleIU(bundleDescription, dirBundleTarget.isDirectory(), key);
bundlePool.addDescriptor(descriptor, new NullProgressMonitor());
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/MarkStartedActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/MarkStartedActionTest.java
index b57014a6e..f7765760a 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/MarkStartedActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/MarkStartedActionTest.java
@@ -61,7 +61,7 @@ public class MarkStartedActionTest extends AbstractProvisioningTest {
IInstallableUnit iu = createBundleIU(bundleDescription, osgiTarget.isDirectory(), key);
bundlePool.addDescriptor(descriptor, new NullProgressMonitor());
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
@@ -107,7 +107,7 @@ public class MarkStartedActionTest extends AbstractProvisioningTest {
IInstallableUnit iu = createBundleIU(bundleDescription, osgiTarget.isDirectory(), key);
bundlePool.addDescriptor(descriptor, new NullProgressMonitor());
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
@@ -156,7 +156,7 @@ public class MarkStartedActionTest extends AbstractProvisioningTest {
IInstallableUnit iu = createBundleIU(bundleDescription, osgiTarget.isDirectory(), key);
bundlePool.addDescriptor(descriptor, new NullProgressMonitor());
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveJVMArgumentActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveJVMArgumentActionTest.java
index 88e56d9e0..f08f9954a 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveJVMArgumentActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveJVMArgumentActionTest.java
@@ -1,9 +1,9 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others. All rights reserved. This
+ * Copyright (c) 2008, 2017 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 http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors: IBM Corporation - initial API and implementation
******************************************************************************/
package org.eclipse.equinox.p2.tests.touchpoint.eclipse;
@@ -28,7 +28,7 @@ public class RemoveJVMArgumentActionTest extends AbstractProvisioningTest {
}
public void testExecuteUndo() {
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
Properties profileProperties = new Properties();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveProgramArgumentActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveProgramArgumentActionTest.java
index 373017306..6c4146e3d 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveProgramArgumentActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveProgramArgumentActionTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * Copyright (c) 2008, 2017 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
@@ -40,7 +40,7 @@ public class RemoveProgramArgumentActionTest extends AbstractProvisioningTest {
}
public void testExecuteUndo() {
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
Properties profileProperties = new Properties();
@@ -87,7 +87,7 @@ public class RemoveProgramArgumentActionTest extends AbstractProvisioningTest {
IInstallableUnit iu = createBundleIU(bundleDescription, osgiTarget.isDirectory(), key);
bundlePool.addDescriptor(descriptor, new NullProgressMonitor());
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
@@ -100,7 +100,7 @@ public class RemoveProgramArgumentActionTest extends AbstractProvisioningTest {
assertNotNull(manipulator);
String programArg = "-somekey";
- Map keyParameters = new HashMap(parameters);
+ Map<String, Object> keyParameters = new HashMap<>(parameters);
keyParameters.put(ActionConstants.PARM_PROGRAM_ARG, programArg);
manipulator.getLauncherData().addProgramArg(programArg);
@@ -143,7 +143,7 @@ public class RemoveProgramArgumentActionTest extends AbstractProvisioningTest {
IInstallableUnit iu = createBundleIU(bundleDescription, osgiTarget.isDirectory(), key);
bundlePool.addDescriptor(descriptor, new NullProgressMonitor());
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
@@ -156,7 +156,7 @@ public class RemoveProgramArgumentActionTest extends AbstractProvisioningTest {
assertNotNull(manipulator);
String programArg = "-somekey";
- Map keyParameters = new HashMap(parameters);
+ Map<String, Object> keyParameters = new HashMap<>(parameters);
keyParameters.put(ActionConstants.PARM_PROGRAM_ARG, programArg);
manipulator.getLauncherData().addProgramArg(programArg);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveProgramPropertyActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveProgramPropertyActionTest.java
index 10587b926..8c76087a8 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveProgramPropertyActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveProgramPropertyActionTest.java
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
+ * Copyright (c) 2011, 2017 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
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -32,7 +32,7 @@ public class RemoveProgramPropertyActionTest extends AbstractProvisioningTest {
public void testExecuteUndo() {
// setup
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
Properties profileProperties = new Properties();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveSourceBundleActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveSourceBundleActionTest.java
index 7dfe5fadc..baeeaa11f 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveSourceBundleActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/RemoveSourceBundleActionTest.java
@@ -60,7 +60,7 @@ public class RemoveSourceBundleActionTest extends AbstractProvisioningTest {
IInstallableUnit iu = createBundleIU(bundleDescription, osgiTarget.isDirectory(), key);
bundlePool.addDescriptor(descriptor, new NullProgressMonitor());
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetFrameworkDependentPropertyActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetFrameworkDependentPropertyActionTest.java
index da6ad0604..e14f4043e 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetFrameworkDependentPropertyActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetFrameworkDependentPropertyActionTest.java
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * Copyright (c) 2008, 2017 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
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -30,7 +30,7 @@ public class SetFrameworkDependentPropertyActionTest extends AbstractProvisionin
}
public void testExecuteUndo() {
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
Properties profileProperties = new Properties();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetFrameworkIndependentPropertyActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetFrameworkIndependentPropertyActionTest.java
index 9f5f05cba..3a89a810f 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetFrameworkIndependentPropertyActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetFrameworkIndependentPropertyActionTest.java
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * Copyright (c) 2008, 2017 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
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -30,7 +30,7 @@ public class SetFrameworkIndependentPropertyActionTest extends AbstractProvision
}
public void testExecuteUndo() {
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
Properties profileProperties = new Properties();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetLauncherNameActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetLauncherNameActionTest.java
index c3a83b024..3e0bab566 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetLauncherNameActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetLauncherNameActionTest.java
@@ -1,9 +1,9 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others. All rights reserved. This
+ * Copyright (c) 2008, 2017 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 http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors: IBM Corporation - initial API and implementation
******************************************************************************/
package org.eclipse.equinox.p2.tests.touchpoint.eclipse;
@@ -30,7 +30,7 @@ public class SetLauncherNameActionTest extends AbstractProvisioningTest {
}
public void testExecuteUndo() {
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
Properties profileProperties = new Properties();
@@ -57,7 +57,7 @@ public class SetLauncherNameActionTest extends AbstractProvisioningTest {
}
public void testEmptyName() {
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
@@ -91,7 +91,7 @@ public class SetLauncherNameActionTest extends AbstractProvisioningTest {
profileProperties.put(IProfile.PROP_ENVIRONMENTS, "osgi.ws=win32,osgi.os=win32,osgi.arch=x86");
IProfile profile = createProfile("changeNameProfile", profileProperties);
- //profile will start using "eclipse" by default, give it some content and see if it
+ //profile will start using "eclipse" by default, give it some content and see if it
//survives a name change.
File eclipseIni = new File(tempFolder, "eclipse.ini");
StringBuffer ini = new StringBuffer();
@@ -99,7 +99,7 @@ public class SetLauncherNameActionTest extends AbstractProvisioningTest {
ini.append("plugins/org.eclipse.equinox.launcher_1.2.4.v1234.jar\n");
writeBuffer(eclipseIni, ini);
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
InstallableUnitOperand operand = new InstallableUnitOperand(null, createIU("test"));
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetProgramPropertyActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetProgramPropertyActionTest.java
index a7d7286b0..fbfbdc07e 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetProgramPropertyActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetProgramPropertyActionTest.java
@@ -40,7 +40,7 @@ public class SetProgramPropertyActionTest extends AbstractProvisioningTest {
}
public void testExecuteUndo() {
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
Properties profileProperties = new Properties();
@@ -87,7 +87,7 @@ public class SetProgramPropertyActionTest extends AbstractProvisioningTest {
IInstallableUnit iu = createBundleIU(bundleDescription, osgiTarget.isDirectory(), key);
bundlePool.addDescriptor(descriptor, new NullProgressMonitor());
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
@@ -115,7 +115,7 @@ public class SetProgramPropertyActionTest extends AbstractProvisioningTest {
action.execute(parameters);
assertTrue(manipulator.getConfigData().getProperty("test").equals(resolvedArtifact));
- parameters = new HashMap(parameters);
+ parameters = new HashMap<>(parameters);
parameters.remove(ActionConstants.PARM_PROP_VALUE);
parameters = Collections.unmodifiableMap(parameters);
action.execute(parameters);
@@ -144,7 +144,7 @@ public class SetProgramPropertyActionTest extends AbstractProvisioningTest {
IInstallableUnit iu = createBundleIU(bundleDescription, osgiTarget.isDirectory(), key);
bundlePool.addDescriptor(descriptor, new NullProgressMonitor());
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
@@ -172,7 +172,7 @@ public class SetProgramPropertyActionTest extends AbstractProvisioningTest {
action.execute(parameters);
assertTrue(manipulator.getConfigData().getProperty("test").equals(resolvedArtifact));
- parameters = new HashMap(parameters);
+ parameters = new HashMap<>(parameters);
parameters.remove(ActionConstants.PARM_PROP_VALUE);
parameters = Collections.unmodifiableMap(parameters);
action.execute(parameters);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetStartLevelActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetStartLevelActionTest.java
index 6559810d7..91256a537 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetStartLevelActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/SetStartLevelActionTest.java
@@ -61,7 +61,7 @@ public class SetStartLevelActionTest extends AbstractProvisioningTest {
IInstallableUnit iu = createBundleIU(bundleDescription, osgiTarget.isDirectory(), key);
bundlePool.addDescriptor(descriptor, new NullProgressMonitor());
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
@@ -107,7 +107,7 @@ public class SetStartLevelActionTest extends AbstractProvisioningTest {
IInstallableUnit iu = createBundleIU(bundleDescription, osgiTarget.isDirectory(), key);
bundlePool.addDescriptor(descriptor, new NullProgressMonitor());
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
@@ -156,7 +156,7 @@ public class SetStartLevelActionTest extends AbstractProvisioningTest {
IInstallableUnit iu = createBundleIU(bundleDescription, osgiTarget.isDirectory(), key);
bundlePool.addDescriptor(descriptor, new NullProgressMonitor());
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/UninstallBundleActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/UninstallBundleActionTest.java
index e72578c4d..6f591f12b 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/UninstallBundleActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/UninstallBundleActionTest.java
@@ -61,7 +61,7 @@ public class UninstallBundleActionTest extends AbstractProvisioningTest {
IInstallableUnit iu = createBundleIU(bundleDescription, osgiTarget.isDirectory(), key);
bundlePool.addDescriptor(descriptor, new NullProgressMonitor());
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/UninstallFeatureActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/UninstallFeatureActionTest.java
index 07dc97da1..fe2bf8f40 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/UninstallFeatureActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/UninstallFeatureActionTest.java
@@ -70,7 +70,7 @@ public class UninstallFeatureActionTest extends AbstractProvisioningTest {
bundlePool.addDescriptor(descriptor, new NullProgressMonitor());
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
EclipseTouchpoint touchpoint = new EclipseTouchpoint();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/ChmodActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/ChmodActionTest.java
index 92485b30e..f6c3b85f7 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/ChmodActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/ChmodActionTest.java
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * Copyright (c) 2008, 2017 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
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Cloudsmith Inc - ongoing development
@@ -44,7 +44,7 @@ public class ChmodActionTest extends AbstractProvisioningTest {
File zipTarget2 = new File(subDir, "a.zip");
copy("3.0", zipSource, zipTarget2);
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_PROFILE, profile);
NativeTouchpoint touchpoint = new NativeTouchpoint();
touchpoint.initializePhase(null, profile, "testExecuteUndo", parameters);
@@ -52,7 +52,7 @@ public class ChmodActionTest extends AbstractProvisioningTest {
parameters.put(ActionConstants.PARM_TARGET_DIR, installFolder.getAbsolutePath());
parameters.put(ActionConstants.PARM_TARGET_FILE, "a.zip");
parameters.put(ActionConstants.PARM_PERMISSIONS, "+x");
- Map xparameters = Collections.unmodifiableMap(parameters);
+ Map<String, Object> xparameters = Collections.unmodifiableMap(parameters);
// TODO: We need a way to verify
// one idea is to run an executable here (or chmod with -w, -r and then test that files are unreadable
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/CleanupzipActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/CleanupzipActionTest.java
index c54d25567..3ed153312 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/CleanupzipActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/CleanupzipActionTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * Copyright (c) 2008, 2017 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
@@ -58,7 +58,7 @@ public class CleanupzipActionTest extends AbstractProvisioningTest {
iuDesc.setTouchpointType(PublisherHelper.TOUCHPOINT_NATIVE);
IInstallableUnit iu = MetadataFactory.createInstallableUnit(iuDesc);
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_PROFILE, profile);
parameters.put("iu", iu);
NativeTouchpoint touchpoint = new NativeTouchpoint();
@@ -103,7 +103,7 @@ public class CleanupzipActionTest extends AbstractProvisioningTest {
iuDesc.setTouchpointType(PublisherHelper.TOUCHPOINT_NATIVE);
IInstallableUnit iu = MetadataFactory.createInstallableUnit(iuDesc);
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_PROFILE, profile);
parameters.put("iu", iu);
NativeTouchpoint touchpoint = new NativeTouchpoint();
@@ -156,7 +156,7 @@ public class CleanupzipActionTest extends AbstractProvisioningTest {
iuDesc.setTouchpointType(PublisherHelper.TOUCHPOINT_NATIVE);
IInstallableUnit iu = MetadataFactory.createInstallableUnit(iuDesc);
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_PROFILE, profile);
parameters.put("iu", iu);
NativeTouchpoint touchpoint = new NativeTouchpoint();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/CollectActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/CollectActionTest.java
index 55a1591f0..3e1fba462 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/CollectActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/CollectActionTest.java
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * Copyright (c) 2008, 2017 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
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -51,7 +51,7 @@ public class CollectActionTest extends AbstractProvisioningTest {
iuDesc.setTouchpointType(PublisherHelper.TOUCHPOINT_NATIVE);
IInstallableUnit iu = MetadataFactory.createInstallableUnit(iuDesc);
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_AGENT, getAgent());
parameters.put(ActionConstants.PARM_PROFILE, profile);
parameters.put(Collect.PARM_ARTIFACT_REQUESTS, new ArrayList<IArtifactRequest[]>());
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/CopyActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/CopyActionTest.java
index 75ebba603..37e24f2ce 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/CopyActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/CopyActionTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010 Cloudsmith Inc. and others.
+ * Copyright (c) 2009, 2017 Cloudsmith Inc. 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
@@ -32,8 +32,8 @@ public class CopyActionTest extends AbstractProvisioningTest {
}
public void testExecuteUndo() {
- Map parameters = createParameters("/testData/nativeTouchpoint/aFolder/a.txt", "a.txt", false);
- Map safeParameters = Collections.unmodifiableMap(parameters);
+ Map<String, Object> parameters = createParameters("/testData/nativeTouchpoint/aFolder/a.txt", "a.txt", false);
+ Map<String, Object> safeParameters = Collections.unmodifiableMap(parameters);
CopyAction action = new CopyAction();
action.execute(safeParameters);
@@ -48,8 +48,8 @@ public class CopyActionTest extends AbstractProvisioningTest {
}
public void testCopyDirectory() {
- Map parameters = createParameters("/testData/nativeTouchpoint/aFolder/", "aFolder", false);
- Map safeParameters = Collections.unmodifiableMap(parameters);
+ Map<String, Object> parameters = createParameters("/testData/nativeTouchpoint/aFolder/", "aFolder", false);
+ Map<String, Object> safeParameters = Collections.unmodifiableMap(parameters);
CopyAction action = new CopyAction();
action.execute(safeParameters);
@@ -65,8 +65,8 @@ public class CopyActionTest extends AbstractProvisioningTest {
}
public void testMergeDirectory() {
- Map parameters1 = createParameters("/testData/nativeTouchpoint/xFolder/", "aFolder", true);
- Map safeParameters1 = Collections.unmodifiableMap(parameters1);
+ Map<String, Object> parameters1 = createParameters("/testData/nativeTouchpoint/xFolder/", "aFolder", true);
+ Map<String, Object> safeParameters1 = Collections.unmodifiableMap(parameters1);
CopyAction action1 = new CopyAction();
action1.execute(safeParameters1);
@@ -76,10 +76,10 @@ public class CopyActionTest extends AbstractProvisioningTest {
assertFileContent("copied content X", new File(target, "x.txt"), "X");
assertFileContent("copied content Y", new File(target, "y.txt"), "Y");
- Map parameters2 = new HashMap();
+ Map<String, Object> parameters2 = new HashMap<>();
parameters2.putAll(parameters1);
parameters2.put(ActionConstants.PARM_COPY_SOURCE, getTestData("get folder A", "/testData/nativeTouchpoint/aFolder/").getAbsolutePath());
- Map safeParameters2 = Collections.unmodifiableMap(parameters2);
+ Map<String, Object> safeParameters2 = Collections.unmodifiableMap(parameters2);
CopyAction action2 = new CopyAction();
action2.execute(safeParameters2);
@@ -102,8 +102,8 @@ public class CopyActionTest extends AbstractProvisioningTest {
}
public void testMergeOverwrite() {
- Map parameters1 = createParameters("/testData/nativeTouchpoint/bcFolder/", "aFolder", true);
- Map safeParameters1 = Collections.unmodifiableMap(parameters1);
+ Map<String, Object> parameters1 = createParameters("/testData/nativeTouchpoint/bcFolder/", "aFolder", true);
+ Map<String, Object> safeParameters1 = Collections.unmodifiableMap(parameters1);
CopyAction action1 = new CopyAction();
action1.execute(safeParameters1);
@@ -112,10 +112,10 @@ public class CopyActionTest extends AbstractProvisioningTest {
File target = new File((String) parameters1.get(ActionConstants.PARM_COPY_TARGET));
assertFileContent("copied content C", new File(target, "b.txt"), "C"); // [sic]
- Map parameters2 = new HashMap();
+ Map<String, Object> parameters2 = new HashMap<>();
parameters2.putAll(parameters1);
parameters2.put(ActionConstants.PARM_COPY_SOURCE, getTestData("get folder A", "/testData/nativeTouchpoint/aFolder/").getAbsolutePath());
- Map safeParameters2 = Collections.unmodifiableMap(parameters2);
+ Map<String, Object> safeParameters2 = Collections.unmodifiableMap(parameters2);
CopyAction action2 = new CopyAction();
action2.execute(safeParameters2);
@@ -128,8 +128,8 @@ public class CopyActionTest extends AbstractProvisioningTest {
}
public void testBlockedMergeOverwrite() {
- Map parameters1 = createParameters("/testData/nativeTouchpoint/bcFolder/", "aFolder", false);
- Map safeParameters1 = Collections.unmodifiableMap(parameters1);
+ Map<String, Object> parameters1 = createParameters("/testData/nativeTouchpoint/bcFolder/", "aFolder", false);
+ Map<String, Object> safeParameters1 = Collections.unmodifiableMap(parameters1);
CopyAction action1 = new CopyAction();
action1.execute(safeParameters1);
@@ -138,10 +138,10 @@ public class CopyActionTest extends AbstractProvisioningTest {
File target = new File((String) parameters1.get(ActionConstants.PARM_COPY_TARGET));
assertFileContent("copied content B", new File(target, "b.txt"), "C"); // [sic]
- Map parameters2 = new HashMap();
+ Map<String, Object> parameters2 = new HashMap<>();
parameters2.putAll(parameters1);
parameters2.put(ActionConstants.PARM_COPY_SOURCE, getTestData("get folder A", "/testData/nativeTouchpoint/aFolder/").getAbsolutePath());
- Map safeParameters2 = Collections.unmodifiableMap(parameters2);
+ Map<String, Object> safeParameters2 = Collections.unmodifiableMap(parameters2);
CopyAction action2 = new CopyAction();
assertFalse("Overwrite of b.txt should not succeed", action2.execute(safeParameters2).isOK());
@@ -150,8 +150,8 @@ public class CopyActionTest extends AbstractProvisioningTest {
}
public void testOverwrite() {
- Map parameters = createParameters("/testData/nativeTouchpoint/aFolder/a.txt", "a.txt", true);
- Map safeParameters = Collections.unmodifiableMap(parameters);
+ Map<String, Object> parameters = createParameters("/testData/nativeTouchpoint/aFolder/a.txt", "a.txt", true);
+ Map<String, Object> safeParameters = Collections.unmodifiableMap(parameters);
File source = new File((String) parameters.get(ActionConstants.PARM_COPY_SOURCE));
File target = new File((String) parameters.get(ActionConstants.PARM_COPY_TARGET));
@@ -171,8 +171,8 @@ public class CopyActionTest extends AbstractProvisioningTest {
}
public void testBlockedOverwrite() {
- Map parameters = createParameters("/testData/nativeTouchpoint/aFolder/a.txt", "a.txt", false);
- Map safeParameters = Collections.unmodifiableMap(parameters);
+ Map<String, Object> parameters = createParameters("/testData/nativeTouchpoint/aFolder/a.txt", "a.txt", false);
+ Map<String, Object> safeParameters = Collections.unmodifiableMap(parameters);
File source = new File((String) parameters.get(ActionConstants.PARM_COPY_SOURCE));
File target = new File((String) parameters.get(ActionConstants.PARM_COPY_TARGET));
@@ -199,7 +199,7 @@ public class CopyActionTest extends AbstractProvisioningTest {
* - copy of directory - check that it merges
* - copy of directory with overwrite false/true
*/
- private Map createParameters(String sourceName, String targetName, boolean overwrite) {
+ private Map<String, Object> createParameters(String sourceName, String targetName, boolean overwrite) {
Properties profileProperties = new Properties();
File installFolder = getTempFolder();
profileProperties.setProperty(IProfile.PROP_INSTALL_FOLDER, installFolder.toString());
@@ -216,7 +216,7 @@ public class CopyActionTest extends AbstractProvisioningTest {
iuDesc.setTouchpointType(PublisherHelper.TOUCHPOINT_NATIVE);
IInstallableUnit iu = MetadataFactory.createInstallableUnit(iuDesc);
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_PROFILE, profile);
parameters.put("iu", iu);
parameters.put(ActionConstants.PARM_PROFILE, profile);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/LinkActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/LinkActionTest.java
index e8248741c..8f9278c1c 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/LinkActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/LinkActionTest.java
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * Copyright (c) 2008, 2017 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
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -38,7 +38,7 @@ public class LinkActionTest extends AbstractProvisioningTest {
File zipTarget = new File(installFolder, "a.zip");
copy("2.0", zipSource, zipTarget);
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_PROFILE, profile);
NativeTouchpoint touchpoint = new NativeTouchpoint();
touchpoint.initializePhase(null, profile, "test", parameters);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/MkdirActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/MkdirActionTest.java
index 2bb03e183..0a0003a3f 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/MkdirActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/MkdirActionTest.java
@@ -1,9 +1,9 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others. All rights reserved. This
+ * Copyright (c) 2008, 2017 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 http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors: IBM Corporation - initial API and implementation
******************************************************************************/
package org.eclipse.equinox.p2.tests.touchpoint.natives;
@@ -32,7 +32,7 @@ public class MkdirActionTest extends AbstractProvisioningTest {
profileProperties.setProperty(IProfile.PROP_INSTALL_FOLDER, installFolder.toString());
IProfile profile = createProfile("test", profileProperties);
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_PROFILE, profile);
NativeTouchpoint touchpoint = new NativeTouchpoint();
touchpoint.initializePhase(null, profile, "test", parameters);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/RemoveActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/RemoveActionTest.java
index 418587bc0..5ece8bef1 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/RemoveActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/RemoveActionTest.java
@@ -26,7 +26,7 @@ public class RemoveActionTest extends AbstractProvisioningTest {
private File testFolder;
private File testFile;
- private Map parameters;
+ private Map<String, Object> parameters;
private RemoveAction action;
public RemoveActionTest(String name) {
@@ -55,7 +55,7 @@ public class RemoveActionTest extends AbstractProvisioningTest {
profileProperties.setProperty(IProfile.PROP_INSTALL_FOLDER, installFolder.toString());
IProfile profile = createProfile("testExecuteUndo", profileProperties);
- parameters = new HashMap();
+ parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_PROFILE, profile);
NativeTouchpoint touchpoint = new NativeTouchpoint();
touchpoint.initializePhase(null, profile, "testExecuteUndo", parameters);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/RmdirActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/RmdirActionTest.java
index f629943cf..9e11edc7f 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/RmdirActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/RmdirActionTest.java
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * Copyright (c) 2008, 2017 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
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -36,7 +36,7 @@ public class RmdirActionTest extends AbstractProvisioningTest {
profileProperties.setProperty(IProfile.PROP_INSTALL_FOLDER, installFolder.toString());
IProfile profile = createProfile("testExecuteUndo", profileProperties);
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_PROFILE, profile);
NativeTouchpoint touchpoint = new NativeTouchpoint();
touchpoint.initializePhase(null, profile, "testExecuteUndo", parameters);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/UnzipActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/UnzipActionTest.java
index a0539cab0..755c1c1b3 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/UnzipActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/natives/UnzipActionTest.java
@@ -56,7 +56,7 @@ public class UnzipActionTest extends AbstractProvisioningTest {
iuDesc.setTouchpointType(PublisherHelper.TOUCHPOINT_NATIVE);
IInstallableUnit iu = MetadataFactory.createInstallableUnit(iuDesc);
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_PROFILE, profile);
parameters.put("iu", iu);
parameters.put(ActionConstants.PARM_PROFILE, profile);
@@ -96,7 +96,7 @@ public class UnzipActionTest extends AbstractProvisioningTest {
iuDesc.setTouchpointType(PublisherHelper.TOUCHPOINT_NATIVE);
IInstallableUnit iu = MetadataFactory.createInstallableUnit(iuDesc);
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_PROFILE, profile);
parameters.put("iu", iu);
parameters.put(ActionConstants.PARM_PROFILE, profile);
@@ -155,7 +155,7 @@ public class UnzipActionTest extends AbstractProvisioningTest {
iuDesc.setTouchpointType(PublisherHelper.TOUCHPOINT_NATIVE);
IInstallableUnit iu = MetadataFactory.createInstallableUnit(iuDesc);
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_PROFILE, profile);
parameters.put("iu", iu);
parameters.put(ActionConstants.PARM_PROFILE, profile);
@@ -320,7 +320,7 @@ public class UnzipActionTest extends AbstractProvisioningTest {
iuDesc.setTouchpointType(PublisherHelper.TOUCHPOINT_NATIVE);
IInstallableUnit iu = MetadataFactory.createInstallableUnit(iuDesc);
- Map parameters = new HashMap();
+ Map<String, Object> parameters = new HashMap<>();
parameters.put(ActionConstants.PARM_PROFILE, profile);
parameters.put("iu", iu);
parameters.put(ActionConstants.PARM_PROFILE, profile);

Back to the top