Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2020-09-17 05:44:12 +0000
committerAlexander Kurtakov2020-09-17 05:44:12 +0000
commit4722c6d4706d7bcf7cdf3efbfa6946027c146b06 (patch)
treee31f768c195fb7754ab4b0ef7284b4687e0004e0 /bundles/org.eclipse.equinox.p2.tests/src
parenta8324786b26c6fa6ca155f8f606bb1333fd4ae53 (diff)
downloadrt.equinox.p2-4722c6d4706d7bcf7cdf3efbfa6946027c146b06.tar.gz
rt.equinox.p2-4722c6d4706d7bcf7cdf3efbfa6946027c146b06.tar.xz
rt.equinox.p2-4722c6d4706d7bcf7cdf3efbfa6946027c146b06.zip
Remove redundant type specifications.
Change-Id: Ia01c0278f1d725700dfbd24df169e8917c5234de Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests/src')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AdditionalCoreMatchers.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/AggregateQueryTest.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CollectorTest.java21
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CompoundQueryableTest.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ActionTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/RootIUActionTest.java25
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/StatusMatchers.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/PerformanceTest.java10
8 files changed, 61 insertions, 39 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AdditionalCoreMatchers.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AdditionalCoreMatchers.java
index 492f4ea6b..f204316db 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AdditionalCoreMatchers.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AdditionalCoreMatchers.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015, 2017 SAP SE and others.
+ * Copyright (c) 2015, 2020 SAP SE and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -14,7 +14,9 @@
package org.eclipse.equinox.p2.tests;
import java.util.Collection;
-import org.hamcrest.*;
+import org.hamcrest.Description;
+import org.hamcrest.Matcher;
+import org.hamcrest.TypeSafeMatcher;
public class AdditionalCoreMatchers {
@@ -24,7 +26,7 @@ public class AdditionalCoreMatchers {
* @see CoreMatchers#hasItem(Matcher)
*/
public static <T> Matcher<Collection<? extends T>> hasSize(final int size) {
- return new TypeSafeMatcher<Collection<? extends T>>() {
+ return new TypeSafeMatcher<>() {
@Override
public void describeTo(Description description) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/AggregateQueryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/AggregateQueryTest.java
index 454736ce0..2ae9e0ea8 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/AggregateQueryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/AggregateQueryTest.java
@@ -148,7 +148,7 @@ public class AggregateQueryTest {
@Test
public void testIntersection() {
- IQuery<String> ABC = new MatchQuery<String>() {
+ IQuery<String> ABC = new MatchQuery<>() {
@Override
public boolean isMatch(String candidate) {
if (candidate.equals("A") || candidate.equals("B") || candidate.equals("C"))
@@ -157,7 +157,7 @@ public class AggregateQueryTest {
}
};
- IQuery<String> BCDE = new MatchQuery<String>() {
+ IQuery<String> BCDE = new MatchQuery<>() {
@Override
public boolean isMatch(String candidate) {
if (candidate.equals("B") || candidate.equals("C") || candidate.equals("D") || candidate.equals("E"))
@@ -210,7 +210,7 @@ public class AggregateQueryTest {
@Test
public void testUnion() {
- IQuery<String> ABC = new MatchQuery<String>() {
+ IQuery<String> ABC = new MatchQuery<>() {
@Override
public boolean isMatch(String candidate) {
if (candidate.equals("A") || candidate.equals("B") || candidate.equals("C"))
@@ -219,7 +219,7 @@ public class AggregateQueryTest {
}
};
- IQuery<String> BCDE = new MatchQuery<String>() {
+ IQuery<String> BCDE = new MatchQuery<>() {
@Override
public boolean isMatch(String candidate) {
if (candidate.equals("B") || candidate.equals("C") || candidate.equals("D") || candidate.equals("E"))
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CollectorTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CollectorTest.java
index d32cc2b95..a1865ab3b 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CollectorTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CollectorTest.java
@@ -14,8 +14,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.core;
-import java.util.*;
-import org.eclipse.equinox.p2.query.*;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.equinox.p2.query.Collector;
+import org.eclipse.equinox.p2.query.IQuery;
+import org.eclipse.equinox.p2.query.IQueryResult;
+import org.eclipse.equinox.p2.query.MatchQuery;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
/**
@@ -50,7 +55,7 @@ public class CollectorTest extends AbstractProvisioningTest {
public void testCompositeCollectors() {
String[] s = new String[] {"A", "B", "C", "D", "E", "F", "G", "1", "2", "3", "4", "5", "6", "7"};
List<String> list = Arrays.asList(s);
- IQuery<String> numeric = new MatchQuery<String>() {
+ IQuery<String> numeric = new MatchQuery<>() {
@Override
public boolean isMatch(String candidate) {
@@ -61,7 +66,7 @@ public class CollectorTest extends AbstractProvisioningTest {
}
};
- IQuery<String> fourOrFiveOrABC = new MatchQuery<String>() {
+ IQuery<String> fourOrFiveOrABC = new MatchQuery<>() {
@Override
public boolean isMatch(String candidate) {
if (candidate.equals("4") || candidate.equals("5") || candidate.equals("A") || candidate.equals("B") || candidate.equals("C")) {
@@ -82,7 +87,7 @@ public class CollectorTest extends AbstractProvisioningTest {
public void testSameCollector() {
String[] s = new String[] {"A", "B", "C", "D", "E", "F", "G", "1", "2", "3", "4", "5", "6", "7"};
List<String> list = Arrays.asList(s);
- IQuery<String> numeric = new MatchQuery<String>() {
+ IQuery<String> numeric = new MatchQuery<>() {
@Override
public boolean isMatch(String candidate) {
@@ -93,7 +98,7 @@ public class CollectorTest extends AbstractProvisioningTest {
}
};
- IQuery<String> fourOrFiveOrABC = new MatchQuery<String>() {
+ IQuery<String> fourOrFiveOrABC = new MatchQuery<>() {
@Override
public boolean isMatch(String candidate) {
if (candidate.equals("4") || candidate.equals("5") || candidate.equals("A") || candidate.equals("B") || candidate.equals("C")) {
@@ -117,7 +122,7 @@ public class CollectorTest extends AbstractProvisioningTest {
public void testEmptyCompositeCollectors() {
String[] s = new String[] {"A", "B", "C", "D", "E", "F", "G", "1", "2", "3", "4", "5", "6", "7"};
List<String> list = Arrays.asList(s);
- IQuery<String> eightOrNine = new MatchQuery<String>() {
+ IQuery<String> eightOrNine = new MatchQuery<>() {
@Override
public boolean isMatch(String candidate) {
@@ -128,7 +133,7 @@ public class CollectorTest extends AbstractProvisioningTest {
}
};
- IQuery<String> fourOrFiveOrABC = new MatchQuery<String>() {
+ IQuery<String> fourOrFiveOrABC = new MatchQuery<>() {
@Override
public boolean isMatch(String candidate) {
if (candidate.equals("4") || candidate.equals("5") || candidate.equals("A") || candidate.equals("B") || candidate.equals("C")) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CompoundQueryableTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CompoundQueryableTest.java
index 8a71e2bdc..d8b434d74 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CompoundQueryableTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CompoundQueryableTest.java
@@ -71,7 +71,7 @@ public class CompoundQueryableTest {
return Arrays.asList(array).iterator();
}
- IQueryable<Integer> queryable1 = new IQueryable<Integer>() {
+ IQueryable<Integer> queryable1 = new IQueryable<>() {
Integer[] elements = new Integer[] {1, 2, 3, 4, 5};
@Override
@@ -88,7 +88,7 @@ public class CompoundQueryableTest {
}
};
- IQueryable<Integer> queryable2 = new IQueryable<Integer>() {
+ IQueryable<Integer> queryable2 = new IQueryable<>() {
Integer[] elements = new Integer[] {4, 6, 8, 10, 12};
@Override
@@ -105,7 +105,7 @@ public class CompoundQueryableTest {
}
};
- IQueryable<Integer> queryable3 = new IQueryable<Integer>() {
+ IQueryable<Integer> queryable3 = new IQueryable<>() {
Integer[] elements = new Integer[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};
@Override
@@ -122,7 +122,7 @@ public class CompoundQueryableTest {
}
};
- IQuery<Integer> matchQuery = new MatchQuery<Integer>() {
+ IQuery<Integer> matchQuery = new MatchQuery<>() {
@Override
public boolean isMatch(Integer candidate) {
@@ -133,7 +133,7 @@ public class CompoundQueryableTest {
}
};
- IQuery<Integer> matchMod4query = new MatchQuery<Integer>() {
+ IQuery<Integer> matchMod4query = new MatchQuery<>() {
@Override
public boolean isMatch(Integer candidate) {
int x = candidate.intValue();
@@ -143,7 +143,7 @@ public class CompoundQueryableTest {
}
};
- IQuery<Integer> contextQuery = new ContextQuery<Integer>() {
+ IQuery<Integer> contextQuery = new ContextQuery<>() {
@Override
public Collector<Integer> perform(Iterator<Integer> iterator) {
@@ -159,7 +159,7 @@ public class CompoundQueryableTest {
};
- IQuery<Integer> greatestNumberQuery = new ContextQuery<Integer>() {
+ IQuery<Integer> greatestNumberQuery = new ContextQuery<>() {
@Override
public Collector<Integer> perform(Iterator<Integer> iterator) {
Collector<Integer> result = new Collector<>();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ActionTest.java
index 462bcd15a..1741c7878 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ActionTest.java
@@ -242,7 +242,7 @@ public abstract class ActionTest extends AbstractProvisioningTest {
public static Matcher<IPublisherResult> containsIU(final String id) {
final IQuery<IInstallableUnit> query = QueryUtil.createIUQuery(id);
- return new TypeSafeMatcher<IPublisherResult>() {
+ return new TypeSafeMatcher<>() {
@Override
public void describeTo(Description description) {
@@ -259,7 +259,7 @@ public abstract class ActionTest extends AbstractProvisioningTest {
public static Matcher<IPublisherResult> containsUniqueIU(final String id) {
final IQuery<IInstallableUnit> query = QueryUtil.createIUQuery(id);
- return new TypeSafeMatcher<IPublisherResult>() {
+ return new TypeSafeMatcher<>() {
@Override
public void describeTo(Description description) {
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 6d2ba8201..21b4dd4b2 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
@@ -17,13 +17,26 @@ package org.eclipse.equinox.p2.tests.publisher.actions;
import static org.easymock.EasyMock.expect;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
-import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.IRequirement;
+import org.eclipse.equinox.p2.metadata.Version;
import org.eclipse.equinox.p2.publisher.IPublisherResult;
-import org.eclipse.equinox.p2.publisher.actions.*;
+import org.eclipse.equinox.p2.publisher.actions.IAdditionalInstallableUnitAdvice;
+import org.eclipse.equinox.p2.publisher.actions.ICapabilityAdvice;
+import org.eclipse.equinox.p2.publisher.actions.ILicenseAdvice;
+import org.eclipse.equinox.p2.publisher.actions.IPropertyAdvice;
+import org.eclipse.equinox.p2.publisher.actions.IRootIUAdvice;
+import org.eclipse.equinox.p2.publisher.actions.ITouchpointAdvice;
+import org.eclipse.equinox.p2.publisher.actions.IUpdateDescriptorAdvice;
+import org.eclipse.equinox.p2.publisher.actions.IVersionAdvice;
+import org.eclipse.equinox.p2.publisher.actions.RootIUAction;
+import org.eclipse.equinox.p2.publisher.actions.RootIUAdvice;
+import org.eclipse.equinox.p2.publisher.actions.RootIUResultFilterAdvice;
import org.eclipse.equinox.p2.query.IQuery;
import org.eclipse.equinox.p2.query.MatchQuery;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
@@ -233,7 +246,7 @@ public class RootIUActionTest extends ActionTest {
IQuery<IInstallableUnit> query = null;
rootIUAdviceCollection = new ArrayList<>();
if ((testSpec & CONTAINS_A) > 0) {
- query = new MatchQuery<IInstallableUnit>() {
+ query = new MatchQuery<>() {
@Override
public boolean isMatch(IInstallableUnit candidate) {
if (candidate.getId().equals(iu_A))
@@ -244,7 +257,7 @@ public class RootIUActionTest extends ActionTest {
rootIUAdviceCollection.add(new RootIUResultFilterAdvice(query));
}
if ((testSpec & CONTAINS_B) > 0) {
- query = new MatchQuery<IInstallableUnit>() {
+ query = new MatchQuery<>() {
@Override
public boolean isMatch(IInstallableUnit candidate) {
if (candidate.getId().equals(iu_B))
@@ -255,7 +268,7 @@ public class RootIUActionTest extends ActionTest {
rootIUAdviceCollection.add(new RootIUResultFilterAdvice(query));
}
if ((testSpec & EMPTY) > 0) {
- query = new MatchQuery<IInstallableUnit>() {
+ query = new MatchQuery<>() {
@Override
public boolean isMatch(IInstallableUnit candidate) {
return false;
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/StatusMatchers.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/StatusMatchers.java
index e36613494..ba885edcb 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/StatusMatchers.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/StatusMatchers.java
@@ -14,12 +14,14 @@
package org.eclipse.equinox.p2.tests.publisher.actions;
import org.eclipse.core.runtime.IStatus;
-import org.hamcrest.*;
+import org.hamcrest.Description;
+import org.hamcrest.Matcher;
+import org.hamcrest.TypeSafeMatcher;
public class StatusMatchers {
public static Matcher<IStatus> errorStatus() {
- return new TypeSafeMatcher<IStatus>() {
+ return new TypeSafeMatcher<>() {
@Override
public void describeTo(Description description) {
@@ -34,7 +36,7 @@ public class StatusMatchers {
}
public static Matcher<IStatus> okStatus() {
- return new TypeSafeMatcher<IStatus>() {
+ return new TypeSafeMatcher<>() {
@Override
public void describeTo(Description description) {
@@ -49,7 +51,7 @@ public class StatusMatchers {
}
public static Matcher<IStatus> statusWithMessageWhich(final Matcher<String> messageMatcher) {
- return new TypeSafeMatcher<IStatus>() {
+ return new TypeSafeMatcher<>() {
@Override
public void describeTo(Description description) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/PerformanceTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/PerformanceTest.java
index 3713365f3..2f070abf5 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/PerformanceTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/PerformanceTest.java
@@ -58,7 +58,7 @@ public class PerformanceTest extends AbstractProvisioningTest {
IMetadataRepository repo = getMDR("/testData/galileoM7");
IQuery<IInstallableUnit> expressionQuery = QueryUtil.createMatchQuery("id ~= /com.ibm.*/");
- IQuery<IInstallableUnit> matchQuery = new MatchQuery<IInstallableUnit>() {
+ IQuery<IInstallableUnit> matchQuery = new MatchQuery<>() {
@Override
public boolean isMatch(IInstallableUnit candidate) {
return candidate.getId().startsWith("com.ibm.");
@@ -93,7 +93,7 @@ public class PerformanceTest extends AbstractProvisioningTest {
IMetadataRepository repo = getMDR("/testData/galileoM7");
IQuery<IInstallableUnit> expressionQuery = QueryUtil.createMatchQuery("id == 'org.eclipse.core.resources'");
- IQuery<IInstallableUnit> matchQuery = new MatchQuery<IInstallableUnit>() {
+ IQuery<IInstallableUnit> matchQuery = new MatchQuery<>() {
@Override
public boolean isMatch(IInstallableUnit candidate) {
return candidate.getId().equals("org.eclipse.core.resources");
@@ -128,7 +128,7 @@ public class PerformanceTest extends AbstractProvisioningTest {
IMetadataRepository repo = getMDR("/testData/galileoM7");
IQuery<IInstallableUnit> expressionQuery = QueryUtil.createMatchQuery("providedCapabilities.exists(x | x.namespace == 'org.eclipse.equinox.p2.iu' && x.name == 'org.eclipse.core.resources')");
- IQuery<IInstallableUnit> matchQuery = new MatchQuery<IInstallableUnit>() {
+ IQuery<IInstallableUnit> matchQuery = new MatchQuery<>() {
@Override
public boolean isMatch(IInstallableUnit candidate) {
for (IProvidedCapability capability : candidate.getProvidedCapabilities())
@@ -165,7 +165,7 @@ public class PerformanceTest extends AbstractProvisioningTest {
IMetadataRepository repo = getMDR("/testData/galileoM7");
- IQuery<IInstallableUnit> matchQuery = new MatchQuery<IInstallableUnit>() {
+ IQuery<IInstallableUnit> matchQuery = new MatchQuery<>() {
@Override
public boolean isMatch(IInstallableUnit candidate) {
return candidate.getId().startsWith("org.eclipse.");
@@ -180,7 +180,7 @@ public class PerformanceTest extends AbstractProvisioningTest {
long start = System.currentTimeMillis();
for (int idx = 0; idx < 80; ++idx) {
IQueryResult<IInstallableUnit> everything = repo.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor());
- Iterator<IInstallableUnit> matchIter = new MatchIteratorFilter<IInstallableUnit>(everything.iterator()) {
+ Iterator<IInstallableUnit> matchIter = new MatchIteratorFilter<>(everything.iterator()) {
@Override
protected boolean isMatch(IInstallableUnit candidate) {
return candidate.getId().startsWith("org.eclipse.");

Back to the top