Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2017-05-03 10:04:47 +0000
committerAlexander Kurtakov2017-05-05 10:31:24 +0000
commit89e924e1e1c2d97841a72e5d29da604299037388 (patch)
tree78c90a0052f961bd593cb63225d847c78d8211bb
parentf5e2860f38dba2a002ede84a70bc8dbe30334753 (diff)
downloadrt.equinox.p2-89e924e1e1c2d97841a72e5d29da604299037388.tar.gz
rt.equinox.p2-89e924e1e1c2d97841a72e5d29da604299037388.tar.xz
rt.equinox.p2-89e924e1e1c2d97841a72e5d29da604299037388.zip
Bug 516095 - Remove redundant specification of type arguments from
org.eclipse.equinox.p2.ui Change-Id: I97d013cc1ce68bcd1460bf19b72d4f3eea5ff2de Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/.settings/org.eclipse.jdt.core.prefs52
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ElementQueryDescriptor.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ElementWrapper.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/MessageDialogWithLink.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryProvider.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryableRepositoryManager.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/UpdateManagerCompatibility.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/ColocatedRepositoryAction.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/ProfileModificationAction.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUGroup.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ComboAutoCompleteField.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ContainerCheckedTreeViewer.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/DelayedFilterCheckboxTree.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/InstallWizard.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/PreselectedIUInstallWizard.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ProvisioningOperationWizard.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RemediationGroup.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RepositorySelectionGroup.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SelectableIUsPage.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/UninstallWizard.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/UpdateWizard.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/misc/StringMatcher.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/CategoryElement.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ElementUtils.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ProfileSnapshots.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/QueriedElement.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/QueriedElementWrapper.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/RemedyElementCategory.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/CategoryElementWrapper.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/QueryableUpdates.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/DeferredQueryContentProvider.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/DeferredQueryTreeContentManager.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/IUDetailsLabelProvider.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/IUDragAdapter.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/ProvElementContentProvider.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/AcceptLicensesWizardPage.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/LoadMetadataRepositoryJob.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/RepositoryManipulationPage.java8
38 files changed, 134 insertions, 82 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.ui/.settings/org.eclipse.jdt.core.prefs
index 5c276d08c..0f6f986b3 100644
--- a/bundles/org.eclipse.equinox.p2.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.equinox.p2.ui/.settings/org.eclipse.jdt.core.prefs
@@ -6,6 +6,15 @@ org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
@@ -18,17 +27,23 @@ org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=error
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
@@ -36,7 +51,10 @@ org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
@@ -44,31 +62,65 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=error
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
+org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ElementQueryDescriptor.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ElementQueryDescriptor.java
index 224479dec..a1f1b1a83 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ElementQueryDescriptor.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ElementQueryDescriptor.java
@@ -59,7 +59,7 @@ public class ElementQueryDescriptor {
if (query != null && collector != null && queryable != null)
results.addAll(this.queryable.query(this.query, monitor));
else if (results == null)
- results = new Collector<Object>();
+ results = new Collector<>();
// Let the wrapper analyze the results, even if we didn't perform the query.
// This allows the wrapper to modify the results with explanations.
if (wrapper != null)
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ElementWrapper.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ElementWrapper.java
index ed47b934a..4bc8c1ffe 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ElementWrapper.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ElementWrapper.java
@@ -25,7 +25,7 @@ public abstract class ElementWrapper {
* of UI elements
*/
public Collection<?> getElements(Collector<?> collector) {
- collection = new ArrayList<Object>(collector.size());
+ collection = new ArrayList<>(collector.size());
Iterator<?> iter = collector.iterator();
while (iter.hasNext()) {
Object o = iter.next();
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/MessageDialogWithLink.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/MessageDialogWithLink.java
index 9a1240c8a..a34c20fa5 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/MessageDialogWithLink.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/MessageDialogWithLink.java
@@ -24,7 +24,7 @@ public class MessageDialogWithLink extends MessageDialog {
protected String linkMessage;
protected Link link;
- protected List<SelectionListener> linkListeners = new ArrayList<SelectionListener>();
+ protected List<SelectionListener> linkListeners = new ArrayList<>();
public MessageDialogWithLink(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage, int dialogImageType, String[] dialogButtonLabels, int defaultIndex) {
super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels, defaultIndex);
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryProvider.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryProvider.java
index 9f96758a5..3d47d89fe 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryProvider.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryProvider.java
@@ -59,7 +59,7 @@ public class QueryProvider {
String environments = profile.getProperty(IProfile.PROP_ENVIRONMENTS);
if (environments == null)
return null;
- Map<String, String> result = new HashMap<String, String>();
+ Map<String, String> result = new HashMap<>();
for (StringTokenizer tokenizer = new StringTokenizer(environments, ","); tokenizer.hasMoreElements();) { //$NON-NLS-1$
String entry = tokenizer.nextToken();
int i = entry.indexOf('=');
@@ -127,10 +127,10 @@ public class QueryProvider {
topLevelQuery = QueryUtil.createLatestQuery(topLevelQuery);
if (targetProfile != null)
wrapper.markInstalledIUs(targetProfile, hideInstalled);
- return new ElementQueryDescriptor(queryable, topLevelQuery, new Collector<Object>(), wrapper);
+ return new ElementQueryDescriptor(queryable, topLevelQuery, new Collector<>(), wrapper);
}
// Installed content not a concern for collecting categories
- return new ElementQueryDescriptor(queryable, categoryQuery, new Collector<Object>(), new CategoryElementWrapper(queryable, element));
+ return new ElementQueryDescriptor(queryable, categoryQuery, new Collector<>(), new CategoryElementWrapper(queryable, element));
}
// If it's a category or some other IUElement to drill down in, we get the requirements and show all requirements
@@ -156,14 +156,14 @@ public class QueryProvider {
if (element instanceof CategoryElement) {
if (showLatest)
memberOfCategoryQuery = QueryUtil.createLatestQuery(memberOfCategoryQuery);
- return new ElementQueryDescriptor(queryable, memberOfCategoryQuery, new Collector<Object>(), availableIUWrapper);
+ return new ElementQueryDescriptor(queryable, memberOfCategoryQuery, new Collector<>(), availableIUWrapper);
}
// It is not a category, we want to traverse the requirements that are groups.
IQuery<IInstallableUnit> query = QueryUtil.createCompoundQuery(topLevelQuery, new RequiredIUsQuery(((IIUElement) element).getIU()), true);
if (showLatest)
query = QueryUtil.createLatestQuery(query);
// If it's not a category, these are generic requirements and should be filtered by the visibility property (topLevelQuery)
- return new ElementQueryDescriptor(queryable, query, new Collector<Object>(), availableIUWrapper);
+ return new ElementQueryDescriptor(queryable, query, new Collector<>(), availableIUWrapper);
}
return null;
@@ -185,7 +185,7 @@ public class QueryProvider {
toUpdate = queryResult.toArray(IInstallableUnit.class);
}
QueryableUpdates updateQueryable = new QueryableUpdates(ui, toUpdate);
- return new ElementQueryDescriptor(updateQueryable, context.getShowLatestVersionsOnly() ? QueryUtil.createLatestIUQuery() : QueryUtil.createIUAnyQuery(), new Collector<Object>());
+ return new ElementQueryDescriptor(updateQueryable, context.getShowLatestVersionsOnly() ? QueryUtil.createLatestIUQuery() : QueryUtil.createIUAnyQuery(), new Collector<>());
case INSTALLED_IUS :
// Querying of IU's. We are drilling down into the requirements.
@@ -222,12 +222,12 @@ public class QueryProvider {
case PROFILES :
queryable = new QueryableProfileRegistry(ui);
- return new ElementQueryDescriptor(queryable, QueryUtil.createMatchQuery(IProfile.class, ExpressionUtil.TRUE_EXPRESSION), new Collector<Object>(), new ProfileElementWrapper(null, element));
+ return new ElementQueryDescriptor(queryable, QueryUtil.createMatchQuery(IProfile.class, ExpressionUtil.TRUE_EXPRESSION), new Collector<>(), new ProfileElementWrapper(null, element));
case AVAILABLE_ARTIFACTS :
if (!(queryable instanceof IArtifactRepository))
return null;
- return new ElementQueryDescriptor(queryable, ArtifactKeyQuery.ALL_KEYS, new Collector<Object>(), new ArtifactKeyWrapper((IArtifactRepository) queryable, element));
+ return new ElementQueryDescriptor(queryable, ArtifactKeyQuery.ALL_KEYS, new Collector<>(), new ArtifactKeyWrapper((IArtifactRepository) queryable, element));
default :
return null;
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryableRepositoryManager.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryableRepositoryManager.java
index 64db5f7e4..b02fe5d94 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryableRepositoryManager.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryableRepositoryManager.java
@@ -84,7 +84,7 @@ public abstract class QueryableRepositoryManager<T> implements IQueryable<T> {
}
protected Collection<URI> getRepoLocations(IRepositoryManager<T> manager) {
- Set<URI> locations = new HashSet<URI>();
+ Set<URI> locations = new HashSet<>();
locations.addAll(Arrays.asList(manager.getKnownRepositories(repositoryFlags)));
if (includeDisabledRepos) {
locations.addAll(Arrays.asList(manager.getKnownRepositories(IRepositoryManager.REPOSITORIES_DISABLED | repositoryFlags)));
@@ -152,7 +152,7 @@ public abstract class QueryableRepositoryManager<T> implements IQueryable<T> {
return (IQueryResult<T>) locationsQueriable().query((IQuery<URI>) query, monitor);
}
SubMonitor sub = SubMonitor.convert(monitor, (uris.size() + 1) * 100);
- ArrayList<IRepository<T>> loadedRepos = new ArrayList<IRepository<T>>(uris.size());
+ ArrayList<IRepository<T>> loadedRepos = new ArrayList<>(uris.size());
for (URI uri : uris) {
IRepository<T> repo = null;
try {
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/UpdateManagerCompatibility.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/UpdateManagerCompatibility.java
index 7b1b9a360..b0173c2cc 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/UpdateManagerCompatibility.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/UpdateManagerCompatibility.java
@@ -202,13 +202,13 @@ public class UpdateManagerCompatibility {
}
public static MetadataRepositoryElement[] readBookmarkFile(File file) {
- Vector<MetadataRepositoryElement> bookmarks = new Vector<MetadataRepositoryElement>();
+ Vector<MetadataRepositoryElement> bookmarks = new Vector<>();
parse(file.getAbsolutePath(), bookmarks);
return getSites(bookmarks);
}
public static void writeBookmarkFile(String filename, MetadataRepositoryElement[] sites) {
- Vector<MetadataRepositoryElement> bookmarks = new Vector<MetadataRepositoryElement>(sites.length);
+ Vector<MetadataRepositoryElement> bookmarks = new Vector<>(sites.length);
for (int i = 0; i < sites.length; i++)
bookmarks.add(sites[i]);
store(filename, bookmarks);
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/ColocatedRepositoryAction.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/ColocatedRepositoryAction.java
index eb155ca97..34f3c49ac 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/ColocatedRepositoryAction.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/ColocatedRepositoryAction.java
@@ -27,7 +27,7 @@ public abstract class ColocatedRepositoryAction extends ProvisioningAction {
}
protected URI[] getSelectedLocations(Object[] selectionArray) {
- List<URI> urls = new ArrayList<URI>();
+ List<URI> urls = new ArrayList<>();
for (int i = 0; i < selectionArray.length; i++) {
if (selectionArray[i] instanceof MetadataRepositoryElement)
urls.add(((MetadataRepositoryElement) selectionArray[i]).getLocation());
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/ProfileModificationAction.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/ProfileModificationAction.java
index 86d917729..2a70fb1b5 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/ProfileModificationAction.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/ProfileModificationAction.java
@@ -148,7 +148,7 @@ public abstract class ProfileModificationAction extends ProvisioningAction {
*/
protected List<IInstallableUnit> getSelectedIUs() {
List<?> elements = getStructuredSelection().toList();
- List<IInstallableUnit> iusList = new ArrayList<IInstallableUnit>(elements.size());
+ List<IInstallableUnit> iusList = new ArrayList<>(elements.size());
for (int i = 0; i < elements.size(); i++) {
if (elements.get(i) instanceof IIUElement) {
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUGroup.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUGroup.java
index d0b23ff82..62ee88dd8 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUGroup.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/AvailableIUGroup.java
@@ -296,7 +296,7 @@ public class AvailableIUGroup extends StructuredIUGroup {
@Override
public Object[] getSelectedIUElements() {
Object[] elements = ((IStructuredSelection) viewer.getSelection()).toArray();
- ArrayList<Object> list = new ArrayList<Object>(elements.length);
+ ArrayList<Object> list = new ArrayList<>(elements.length);
for (int i = 0; i < elements.length; i++)
if (ElementUtils.getIU(elements[i]) != null)
list.add(elements[i]);
@@ -315,7 +315,7 @@ public class AvailableIUGroup extends StructuredIUGroup {
Object[] selections = filteredTree.getCheckedElements(); // Get all the elements that have been selected, not just the visible ones
if (selections.length == 0)
return new IInstallableUnit[0];
- ArrayList<IInstallableUnit> leaves = new ArrayList<IInstallableUnit>(selections.length);
+ ArrayList<IInstallableUnit> leaves = new ArrayList<>(selections.length);
for (int i = 0; i < selections.length; i++) {
if (!getCheckboxTreeViewer().getGrayed(selections[i])) {
IInstallableUnit iu = ProvUI.getAdapter(selections[i], IInstallableUnit.class);
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ComboAutoCompleteField.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ComboAutoCompleteField.java
index e60141e56..2dff508a1 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ComboAutoCompleteField.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ComboAutoCompleteField.java
@@ -55,7 +55,7 @@ public class ComboAutoCompleteField {
if (contents.length() == 0 || items.length == 0)
return new IContentProposal[0];
StringMatcher matcher = new StringMatcher("*" + contents + "*", true, false); //$NON-NLS-1$ //$NON-NLS-2$
- ArrayList<String> matches = new ArrayList<String>();
+ ArrayList<String> matches = new ArrayList<>();
for (int i = 0; i < items.length; i++)
if (matcher.match(items[i]))
matches.add(items[i]);
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ContainerCheckedTreeViewer.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ContainerCheckedTreeViewer.java
index 10aca757b..0e4f36aec 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ContainerCheckedTreeViewer.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ContainerCheckedTreeViewer.java
@@ -226,7 +226,7 @@ public class ContainerCheckedTreeViewer extends CheckboxTreeViewer {
public Object[] getCheckedElements() {
Object[] checked = super.getCheckedElements();
// add all items that are children of a checked node but not created yet
- ArrayList<Object> result = new ArrayList<Object>();
+ ArrayList<Object> result = new ArrayList<>();
for (int i = 0; i < checked.length; i++) {
Object curr = checked[i];
result.add(curr);
@@ -285,7 +285,7 @@ public class ContainerCheckedTreeViewer extends CheckboxTreeViewer {
// problem.
private void saveCheckedState() {
Object[] checked = getCheckedElements();
- savedCheckState = new ArrayList<Object>(checked.length);
+ savedCheckState = new ArrayList<>(checked.length);
for (int i = 0; i < checked.length; i++)
if (!isExpandable(checked[i]) && !getGrayed(checked[i]))
savedCheckState.add(checked[i]);
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/DelayedFilterCheckboxTree.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/DelayedFilterCheckboxTree.java
index 62eb5005b..5e2cef597 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/DelayedFilterCheckboxTree.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/DelayedFilterCheckboxTree.java
@@ -48,8 +48,8 @@ public class DelayedFilterCheckboxTree extends FilteredTree {
WorkbenchJob filterJob;
boolean ignoreFiltering = true;
Object viewerInput;
- HashSet<Object> checkState = new HashSet<Object>();
- Set<Object> expanded = new HashSet<Object>();
+ HashSet<Object> checkState = new HashSet<>();
+ Set<Object> expanded = new HashSet<>();
ContainerCheckedTreeViewer checkboxViewer;
public DelayedFilterCheckboxTree(Composite parent, int treeStyle, PatternFilter filter, IPreFilterJobProvider jobProvider) {
@@ -71,13 +71,13 @@ public class DelayedFilterCheckboxTree extends FilteredTree {
if (event.getElement() == ALL_ITEMS_HACK) {
clearCheckStateCache();
} else {
- ArrayList<Object> toRemove = new ArrayList<Object>(1);
+ ArrayList<Object> toRemove = new ArrayList<>(1);
// See bug 258117. Ideally we would get check state changes
// for children when the parent state changed, but we aren't, so
// we need to remove all children from the additive check state
// cache.
if (contentProvider.hasChildren(event.getElement())) {
- Set<Object> unchecked = new HashSet<Object>();
+ Set<Object> unchecked = new HashSet<>();
Object[] children = contentProvider.getChildren(event.getElement());
for (Object element : children) {
unchecked.add(element);
@@ -296,7 +296,7 @@ public class DelayedFilterCheckboxTree extends FilteredTree {
ContainerCheckedTreeViewer v = (ContainerCheckedTreeViewer) getViewer();
Object[] checked = v.getCheckedElements();
if (checkState == null) {
- checkState = new HashSet<Object>(checked.length);
+ checkState = new HashSet<>(checked.length);
}
for (int i = 0; i < checked.length; i++) {
if (!v.getGrayed(checked[i]) && contentProvider.getChildren(checked[i]).length == 0) {
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/InstallWizard.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/InstallWizard.java
index 592489712..21c5794ba 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/InstallWizard.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/InstallWizard.java
@@ -73,8 +73,8 @@ public class InstallWizard extends WizardWithLicenses {
root.setChildren(elements);
planSelections = elements;
} else {
- ArrayList<AvailableIUElement> list = new ArrayList<AvailableIUElement>(selectedElements.length);
- ArrayList<AvailableIUElement> selections = new ArrayList<AvailableIUElement>(selectedElements.length);
+ ArrayList<AvailableIUElement> list = new ArrayList<>(selectedElements.length);
+ ArrayList<AvailableIUElement> selections = new ArrayList<>(selectedElements.length);
for (int i = 0; i < selectedElements.length; i++) {
IInstallableUnit iu = ElementUtils.getIU(selectedElements[i]);
if (iu != null) {
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/PreselectedIUInstallWizard.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/PreselectedIUInstallWizard.java
index 9649d29ad..a0d6dcb6b 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/PreselectedIUInstallWizard.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/PreselectedIUInstallWizard.java
@@ -65,8 +65,8 @@ public class PreselectedIUInstallWizard extends WizardWithLicenses {
@Override
protected void initializeResolutionModelElements(Object[] selectedElements) {
root = new IUElementListRoot(ui);
- ArrayList<AvailableIUElement> list = new ArrayList<AvailableIUElement>(selectedElements.length);
- ArrayList<AvailableIUElement> selected = new ArrayList<AvailableIUElement>(selectedElements.length);
+ ArrayList<AvailableIUElement> list = new ArrayList<>(selectedElements.length);
+ ArrayList<AvailableIUElement> selected = new ArrayList<>(selectedElements.length);
for (int i = 0; i < selectedElements.length; i++) {
IInstallableUnit iu = ElementUtils.getIU(selectedElements[i]);
if (iu != null) {
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ProvisioningOperationWizard.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ProvisioningOperationWizard.java
index f142c086c..da5937ef3 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ProvisioningOperationWizard.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ProvisioningOperationWizard.java
@@ -215,10 +215,10 @@ public abstract class ProvisioningOperationWizard extends Wizard {
}
protected boolean pageSelectionsHaveChanged(ISelectableIUsPage page) {
- HashSet<IInstallableUnit> selectedIUs = new HashSet<IInstallableUnit>();
+ HashSet<IInstallableUnit> selectedIUs = new HashSet<>();
Object[] currentSelections = page.getCheckedIUElements();
selectedIUs.addAll(ElementUtils.elementsToIUs(currentSelections));
- HashSet<IInstallableUnit> lastIUSelections = new HashSet<IInstallableUnit>();
+ HashSet<IInstallableUnit> lastIUSelections = new HashSet<>();
if (planSelections != null)
lastIUSelections.addAll(ElementUtils.elementsToIUs(planSelections));
return !(selectedIUs.equals(lastIUSelections));
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RemediationGroup.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RemediationGroup.java
index 1dc16b2cf..e460acef9 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RemediationGroup.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RemediationGroup.java
@@ -40,7 +40,7 @@ public class RemediationGroup {
private Button bestBeingInstalledRelaxedButton;
private Button bestInstalledRelaxedButton;
Button buildMyOwnSolution;
- final ArrayList<Button> checkboxes = new ArrayList<Button>();
+ final ArrayList<Button> checkboxes = new ArrayList<>();
private Composite resultFoundComposite;
private Composite resultComposite;
private Composite resultNotFoundComposite;
@@ -101,7 +101,7 @@ public class RemediationGroup {
}
public RemediationGroup(WizardPage page) {
- CONSTRAINTS = new HashMap<String, String[]>();
+ CONSTRAINTS = new HashMap<>();
CONSTRAINTS.put(ProvUIMessages.RemediationPage_BeingInstalledSection, new String[] {ProvUIMessages.RemediationPage_BeingInstalledSection_AllowPartialInstall, ProvUIMessages.RemediationPage_BeingInstalledSection_AllowDifferentVersion});
CONSTRAINTS.put(ProvUIMessages.RemediationPage_InstalledSection, new String[] {ProvUIMessages.RemediationPage_InstalledSection_AllowInstalledUpdate, ProvUIMessages.RemediationPage_InstalledSection_AllowInstalledRemoval});
@@ -284,7 +284,7 @@ public class RemediationGroup {
if (element instanceof RemedyIUDetail) {
RemedyIUDetail iuDetail = (RemedyIUDetail) element;
String toolTipText = ""; //$NON-NLS-1$
- List<String> versions = new ArrayList<String>();
+ List<String> versions = new ArrayList<>();
if (iuDetail.getInstalledVersion() != null)
versions.add(ProvUIMessages.RemedyElementInstalledVersion + iuDetail.getInstalledVersion().toString());
if (iuDetail.getRequestedVersion() != null)
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RepositorySelectionGroup.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RepositorySelectionGroup.java
index 4f44b7aef..d4cbbfb9b 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RepositorySelectionGroup.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RepositorySelectionGroup.java
@@ -65,7 +65,7 @@ public class RepositorySelectionGroup {
ProvisioningUI ui;
IUViewQueryContext queryContext;
- ListenerList<IRepositorySelectionListener> listeners = new ListenerList<IRepositorySelectionListener>();
+ ListenerList<IRepositorySelectionListener> listeners = new ListenerList<>();
Combo repoCombo;
Link repoManipulatorLink;
@@ -76,7 +76,7 @@ public class RepositorySelectionGroup {
Image info, warning, error;
URI[] comboRepos; // the URIs shown in the combo, kept in sync with combo items
- HashMap<String, URI> disabledRepoProposals = new HashMap<String, URI>(); // proposal string -> disabled URI
+ HashMap<String, URI> disabledRepoProposals = new HashMap<>(); // proposal string -> disabled URI
public RepositorySelectionGroup(ProvisioningUI ui, IWizardContainer container, Composite parent, IUViewQueryContext queryContext) {
this.container = container;
@@ -403,7 +403,7 @@ public class RepositorySelectionGroup {
int sortEnd = hasLocalSites ? strings.length - 2 : strings.length - 1;
if (sortStart >= sortEnd)
return;
- final HashMap<URI, String> uriToString = new HashMap<URI, String>();
+ final HashMap<URI, String> uriToString = new HashMap<>();
for (int i = sortStart; i <= sortEnd; i++) {
uriToString.put(locations[i], strings[i]);
}
@@ -435,7 +435,7 @@ public class RepositorySelectionGroup {
int flags = ui.getRepositoryTracker().getMetadataRepositoryFlags() | IRepositoryManager.REPOSITORIES_DISABLED;
String[] items = repoCombo.getItems();
// Clear any previously remembered disabled repos
- disabledRepoProposals = new HashMap<String, URI>();
+ disabledRepoProposals = new HashMap<>();
URI[] disabled = getMetadataRepositoryManager().getKnownRepositories(flags);
String[] disabledItems = new String[disabled.length];
for (int i = 0; i < disabledItems.length; i++) {
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SelectableIUsPage.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SelectableIUsPage.java
index 856e11341..227fff909 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SelectableIUsPage.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SelectableIUsPage.java
@@ -253,7 +253,7 @@ public class SelectableIUsPage extends ResolutionStatusPage implements IResoluti
return;
}
- ArrayList<Object> selections = new ArrayList<Object>(initialSelections.length);
+ ArrayList<Object> selections = new ArrayList<>(initialSelections.length);
for (int i = 0; i < initialSelections.length; i++) {
if (initialSelections[i] instanceof AvailableUpdateElement) {
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/UninstallWizard.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/UninstallWizard.java
index f5135fa26..9b85a6578 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/UninstallWizard.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/UninstallWizard.java
@@ -52,8 +52,8 @@ public class UninstallWizard extends ProvisioningOperationWizard {
@Override
protected void initializeResolutionModelElements(Object[] selectedElements) {
root = new IUElementListRoot(ui);
- ArrayList<InstalledIUElement> list = new ArrayList<InstalledIUElement>(selectedElements.length);
- ArrayList<InstalledIUElement> selections = new ArrayList<InstalledIUElement>(selectedElements.length);
+ ArrayList<InstalledIUElement> list = new ArrayList<>(selectedElements.length);
+ ArrayList<InstalledIUElement> selections = new ArrayList<>(selectedElements.length);
for (int i = 0; i < selectedElements.length; i++) {
IInstallableUnit iu = ElementUtils.getIU(selectedElements[i]);
if (iu != null) {
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/UpdateWizard.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/UpdateWizard.java
index 6f25bd834..c82ae5dd9 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/UpdateWizard.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/UpdateWizard.java
@@ -36,7 +36,7 @@ public class UpdateWizard extends WizardWithLicenses {
Update[] initialSelections;
public static Collection<IInstallableUnit> getIUsToReplace(Object[] elements) {
- Set<IInstallableUnit> iusToReplace = new HashSet<IInstallableUnit>();
+ Set<IInstallableUnit> iusToReplace = new HashSet<>();
for (int i = 0; i < elements.length; i++) {
if (elements[i] instanceof AvailableUpdateElement) {
iusToReplace.add(((AvailableUpdateElement) elements[i]).getIUToBeUpdated());
@@ -46,7 +46,7 @@ public class UpdateWizard extends WizardWithLicenses {
}
public static IInstallableUnit[] getReplacementIUs(Object[] elements) {
- Set<IInstallableUnit> replacements = new HashSet<IInstallableUnit>();
+ Set<IInstallableUnit> replacements = new HashSet<>();
for (int i = 0; i < elements.length; i++) {
if (elements[i] instanceof AvailableUpdateElement) {
replacements.add(((AvailableUpdateElement) elements[i]).getIU());
@@ -56,7 +56,7 @@ public class UpdateWizard extends WizardWithLicenses {
}
public static Update[] makeUpdatesFromElements(Object[] elements) {
- Set<Update> updates = new HashSet<Update>();
+ Set<Update> updates = new HashSet<>();
for (int i = 0; i < elements.length; i++) {
if (elements[i] instanceof AvailableUpdateElement) {
updates.add(((AvailableUpdateElement) elements[i]).getUpdate());
@@ -90,7 +90,7 @@ public class UpdateWizard extends WizardWithLicenses {
IProfileRegistry profileRegistry = (IProfileRegistry) ui.getSession().getProvisioningAgent().getService(IProfileRegistry.SERVICE_NAME);
IProfile profile = profileRegistry.getProfile(ui.getProfileId());
- ArrayList<Update> newSelection = new ArrayList<Update>(initialSelections.length);
+ ArrayList<Update> newSelection = new ArrayList<>(initialSelections.length);
for (int i = 0; i < initialSelections.length; i++) {
if (!isLocked(profile, initialSelections[i].toUpdate)) {
newSelection.add(initialSelections[i]);
@@ -125,8 +125,8 @@ public class UpdateWizard extends WizardWithLicenses {
root.setChildren(elements);
//planSelections = elements;
} else {
- ArrayList<AvailableUpdateElement> list = new ArrayList<AvailableUpdateElement>(selectedElements.length);
- ArrayList<AvailableUpdateElement> selected = new ArrayList<AvailableUpdateElement>(selectedElements.length);
+ ArrayList<AvailableUpdateElement> list = new ArrayList<>(selectedElements.length);
+ ArrayList<AvailableUpdateElement> selected = new ArrayList<>(selectedElements.length);
for (int i = 0; i < selectedElements.length; i++) {
if (selectedElements[i] instanceof AvailableUpdateElement) {
AvailableUpdateElement element = (AvailableUpdateElement) selectedElements[i];
@@ -190,7 +190,7 @@ public class UpdateWizard extends WizardWithLicenses {
} else {
updates = ((UpdateOperation) operation).getPossibleUpdates();
}
- ArrayList<AvailableUpdateElement> allPossible = new ArrayList<AvailableUpdateElement>(updates.length);
+ ArrayList<AvailableUpdateElement> allPossible = new ArrayList<>(updates.length);
for (int i = 0; i < updates.length; i++) {
AvailableUpdateElement newElement = new AvailableUpdateElement(firstPageRoot, updates[i].replacement, updates[i].toUpdate, getProfileId(), shouldShowProvisioningPlanChildren());
allPossible.add(newElement);
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/misc/StringMatcher.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/misc/StringMatcher.java
index feaecf03e..11bd6c9a2 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/misc/StringMatcher.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/misc/StringMatcher.java
@@ -284,7 +284,7 @@ public class StringMatcher {
}
}
- Vector<String> temp = new Vector<String>();
+ Vector<String> temp = new Vector<>();
int pos = 0;
StringBuffer buf = new StringBuffer();
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/CategoryElement.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/CategoryElement.java
index 7f36e9a26..f3e58cebe 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/CategoryElement.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/CategoryElement.java
@@ -25,7 +25,7 @@ import org.eclipse.equinox.p2.metadata.IRequirement;
*/
public class CategoryElement extends RemoteQueriedElement implements IIUElement {
- private ArrayList<IInstallableUnit> ius = new ArrayList<IInstallableUnit>(1);
+ private ArrayList<IInstallableUnit> ius = new ArrayList<>(1);
private Collection<IRequirement> requirements;
private Object[] cache = null;
@@ -119,7 +119,7 @@ public class CategoryElement extends RemoteQueriedElement implements IIUElement
if (ius.size() == 1)
requirements = getIU().getRequirements();
else {
- ArrayList<IRequirement> capabilities = new ArrayList<IRequirement>();
+ ArrayList<IRequirement> capabilities = new ArrayList<>();
for (IInstallableUnit iu : ius) {
capabilities.addAll(iu.getRequirements());
}
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ElementUtils.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ElementUtils.java
index 366bcc552..04ff55eda 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ElementUtils.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ElementUtils.java
@@ -71,7 +71,7 @@ public class ElementUtils {
}
// Are there any elements that need to be deleted? Go over the original state
// and remove any elements that weren't in the elements we were given
- Set<String> nowKnown = new HashSet<String>();
+ Set<String> nowKnown = new HashSet<>();
for (int i = 0; i < elements.length; i++)
nowKnown.add(URIUtil.toUnencodedString(elements[i].getLocation()));
for (int i = 0; i < currentlyEnabled.length; i++) {
@@ -105,7 +105,7 @@ public class ElementUtils {
}
public static List<IInstallableUnit> elementsToIUs(Object[] elements) {
- ArrayList<IInstallableUnit> theIUs = new ArrayList<IInstallableUnit>(elements.length);
+ ArrayList<IInstallableUnit> theIUs = new ArrayList<>(elements.length);
for (int i = 0; i < elements.length; i++) {
IInstallableUnit iu = ProvUI.getAdapter(elements[i], IInstallableUnit.class);
if (iu != null)
@@ -128,7 +128,7 @@ public class ElementUtils {
public static AvailableIUElement[] requestToElement(Remedy remedy, boolean installMode) {
if (remedy == null)
return new AvailableIUElement[0];
- ArrayList<AvailableIUElement> temp = new ArrayList<AvailableIUElement>();
+ ArrayList<AvailableIUElement> temp = new ArrayList<>();
ProvisioningUI ui = ProvisioningUI.getDefaultUI();
IUElementListRoot root = new IUElementListRoot(ui);
for (Iterator<RemedyIUDetail> iterator = remedy.getIusDetails().iterator(); iterator.hasNext();) {
@@ -146,7 +146,7 @@ public class ElementUtils {
}
public static RemedyElementCategory[] requestToRemedyElementsCategories(Remedy remedy) {
- List<RemedyElementCategory> categories = new ArrayList<RemedyElementCategory>();
+ List<RemedyElementCategory> categories = new ArrayList<>();
RemedyElementCategory categoryAdded = new RemedyElementCategory(ProvUIMessages.RemedyCategoryAdded);
RemedyElementCategory cateogyRemoved = new RemedyElementCategory(ProvUIMessages.RemedyCategoryRemoved);
RemedyElementCategory categoryNotAdded = new RemedyElementCategory(ProvUIMessages.RemedyCategoryNotAdded);
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ProfileSnapshots.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ProfileSnapshots.java
index 39d4a5ba6..2e3d781a5 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ProfileSnapshots.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/ProfileSnapshots.java
@@ -52,7 +52,7 @@ public class ProfileSnapshots extends ProvElement implements IDeferredWorkbenchA
// find out which profile states we should hide
Map<String, String> hidden = registry.getProfileStateProperties(profileId, IProfile.STATE_PROP_HIDDEN);
Map<String, String> tag = registry.getProfileStateProperties(profileId, IProfile.STATE_PROP_TAG);
- List<RollbackProfileElement> elements = new ArrayList<RollbackProfileElement>();
+ List<RollbackProfileElement> elements = new ArrayList<>();
for (int i = 0; i < timestamps.length; i++) {
if (hidden.containsKey(String.valueOf(timestamps[i])))
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/QueriedElement.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/QueriedElement.java
index 07f9597b8..30049a478 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/QueriedElement.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/QueriedElement.java
@@ -106,7 +106,7 @@ public abstract class QueriedElement extends ProvElement {
Collection<?> results = queryDescriptor.performQuery(monitor);
cachedChildren = Collections.unmodifiableCollection(results);
if (results.size() > 0) {
- Collection<Object> returnedChildren = new HashSet<Object>();
+ Collection<Object> returnedChildren = new HashSet<>();
returnedChildren.addAll(results);
Object[] siblings = getSiblings();
for (int i = 0; i < siblings.length; i++) {
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/QueriedElementWrapper.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/QueriedElementWrapper.java
index e2e518293..fa44b8be9 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/QueriedElementWrapper.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/QueriedElementWrapper.java
@@ -102,7 +102,7 @@ public abstract class QueriedElementWrapper extends ElementWrapper {
}
Collection<?> emptyExplanation(int severity, String explanationString, String explanationDescription) {
- ArrayList<Object> collection = new ArrayList<Object>(1);
+ ArrayList<Object> collection = new ArrayList<>(1);
collection.add(new EmptyElementExplanation(parent, severity, explanationString, explanationDescription));
return collection;
}
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/RemedyElementCategory.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/RemedyElementCategory.java
index 7a262cde9..817b59793 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/RemedyElementCategory.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/RemedyElementCategory.java
@@ -21,7 +21,7 @@ public class RemedyElementCategory {
public RemedyElementCategory(String name) {
this.name = name;
- elements = new ArrayList<RemedyIUDetail>();
+ elements = new ArrayList<>();
}
public List<RemedyIUDetail> getElements() {
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/CategoryElementWrapper.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/CategoryElementWrapper.java
index a5e3e1cb9..0e7227242 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/CategoryElementWrapper.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/CategoryElementWrapper.java
@@ -29,7 +29,7 @@ import org.eclipse.equinox.p2.query.IQueryable;
public class CategoryElementWrapper extends QueriedElementWrapper {
// Used to track nested categories
- private Set<String> referredIUs = new HashSet<String>();
+ private Set<String> referredIUs = new HashSet<>();
public CategoryElementWrapper(IQueryable<?> queryable, Object parent) {
super(queryable, parent);
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/QueryableUpdates.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/QueryableUpdates.java
index 78f1cc1c4..ac2ed0f05 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/QueryableUpdates.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/QueryableUpdates.java
@@ -43,7 +43,7 @@ public class QueryableUpdates implements IQueryable<IInstallableUnit> {
monitor.beginTask(ProvUIMessages.QueryableUpdates_UpdateListProgress, totalWork);
IPlanner planner = (IPlanner) ui.getSession().getProvisioningAgent().getService(IPlanner.SERVICE_NAME);
try {
- Set<IInstallableUnit> allUpdates = new HashSet<IInstallableUnit>();
+ Set<IInstallableUnit> allUpdates = new HashSet<>();
for (int i = 0; i < iusToUpdate.length; i++) {
if (monitor.isCanceled())
return Collector.emptyCollector();
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/DeferredQueryContentProvider.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/DeferredQueryContentProvider.java
index 6ce54694e..981daafdd 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/DeferredQueryContentProvider.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/DeferredQueryContentProvider.java
@@ -30,10 +30,10 @@ public class DeferredQueryContentProvider extends ProvElementContentProvider {
DeferredQueryTreeContentManager manager;
Object currentInput;
- HashMap<Object, Object> alreadyQueried = new HashMap<Object, Object>();
- HashSet<Object> queryCompleted = new HashSet<Object>();
+ HashMap<Object, Object> alreadyQueried = new HashMap<>();
+ HashSet<Object> queryCompleted = new HashSet<>();
AbstractTreeViewer viewer = null;
- ListenerList<IInputChangeListener> listeners = new ListenerList<IInputChangeListener>();
+ ListenerList<IInputChangeListener> listeners = new ListenerList<>();
boolean synchronous = false;
IDeferredQueryTreeListener onFetchingActionListener;
@@ -80,8 +80,8 @@ public class DeferredQueryContentProvider extends ProvElementContentProvider {
});
} else
viewer = null;
- alreadyQueried = new HashMap<Object, Object>();
- queryCompleted = new HashSet<Object>();
+ alreadyQueried = new HashMap<>();
+ queryCompleted = new HashSet<>();
currentInput = newInput;
for (IInputChangeListener listener : listeners) {
listener.inputChanged(v, oldInput, newInput);
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/DeferredQueryTreeContentManager.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/DeferredQueryTreeContentManager.java
index a628372f5..e66b5c3c2 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/DeferredQueryTreeContentManager.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/DeferredQueryTreeContentManager.java
@@ -46,7 +46,7 @@ public class DeferredQueryTreeContentManager extends DeferredTreeContentManager
public DeferredQueryTreeContentManager(AbstractTreeViewer viewer) {
super(viewer);
- listeners = new ListenerList<IDeferredQueryTreeListener>();
+ listeners = new ListenerList<>();
}
/*
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/IUDetailsLabelProvider.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/IUDetailsLabelProvider.java
index 082f9e063..1e6223a5b 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/IUDetailsLabelProvider.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/IUDetailsLabelProvider.java
@@ -42,7 +42,7 @@ public class IUDetailsLabelProvider extends ColumnLabelProvider implements ITabl
private IUColumnConfig[] columnConfig;
Shell shell;
- HashMap<IIUElement, Job> jobs = new HashMap<IIUElement, Job>();
+ HashMap<IIUElement, Job> jobs = new HashMap<>();
public IUDetailsLabelProvider() {
this(null, null, null);
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/IUDragAdapter.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/IUDragAdapter.java
index f27c6879e..eabba44f9 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/IUDragAdapter.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/IUDragAdapter.java
@@ -99,7 +99,7 @@ public class IUDragAdapter extends DragSourceAdapter {
}
private IInstallableUnit[] getSelectedIUs() {
- List<IInstallableUnit> ius = new ArrayList<IInstallableUnit>();
+ List<IInstallableUnit> ius = new ArrayList<>();
ISelection selection = selectionProvider.getSelection();
if (!(selection instanceof IStructuredSelection) || selection.isEmpty()) {
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/ProvElementContentProvider.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/ProvElementContentProvider.java
index 7b9f6627d..d26850ffb 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/ProvElementContentProvider.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/viewers/ProvElementContentProvider.java
@@ -57,7 +57,7 @@ public class ProvElementContentProvider implements ITreeContentProvider {
@Override
protected IStatus run(final IProgressMonitor monitor) {
IDeferredWorkbenchAdapter parent = (IDeferredWorkbenchAdapter) input;
- final ArrayList<Object> children = new ArrayList<Object>();
+ final ArrayList<Object> children = new ArrayList<>();
parent.fetchDeferredChildren(parent, new IElementCollector() {
@Override
public void add(Object element, IProgressMonitor mon) {
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/AcceptLicensesWizardPage.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/AcceptLicensesWizardPage.java
index b470d12a0..a3375d40a 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/AcceptLicensesWizardPage.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/AcceptLicensesWizardPage.java
@@ -361,7 +361,7 @@ public class AcceptLicensesWizardPage extends WizardPage {
private void updateLicenses(IInstallableUnit[] theIUs, IProvisioningPlan plan) {
this.originalIUs = theIUs;
if (theIUs == null)
- licensesToIUs = new HashMap<ILicense, List<IInstallableUnit>>();
+ licensesToIUs = new HashMap<>();
else
findUnacceptedLicenses(theIUs, plan);
setDescription();
@@ -403,8 +403,8 @@ public class AcceptLicensesWizardPage extends WizardPage {
// Current metadata generation can result with a feature group IU and the feature jar IU
// having the same name and license. We will weed out duplicates if the license and name are both
// the same.
- licensesToIUs = new HashMap<ILicense, List<IInstallableUnit>>();//map of License->ArrayList of IUs with that license
- HashMap<ILicense, HashSet<String>> namesSeen = new HashMap<ILicense, HashSet<String>>(); // map of License->HashSet of names with that license
+ licensesToIUs = new HashMap<>();//map of License->ArrayList of IUs with that license
+ HashMap<ILicense, HashSet<String>> namesSeen = new HashMap<>(); // map of License->HashSet of names with that license
for (int i = 0; i < iusToCheck.length; i++) {
IInstallableUnit iu = iusToCheck[i];
for (ILicense license : iu.getLicenses(null)) {
@@ -420,10 +420,10 @@ public class AcceptLicensesWizardPage extends WizardPage {
((ArrayList<IInstallableUnit>) licensesToIUs.get(license)).add(iu);
}
} else {
- ArrayList<IInstallableUnit> list = new ArrayList<IInstallableUnit>(1);
+ ArrayList<IInstallableUnit> list = new ArrayList<>(1);
list.add(iu);
licensesToIUs.put(license, list);
- HashSet<String> names = new HashSet<String>(1);
+ HashSet<String> names = new HashSet<>(1);
names.add(name);
namesSeen.put(license, names);
}
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/LoadMetadataRepositoryJob.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/LoadMetadataRepositoryJob.java
index cb98e6fa5..2eec89c07 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/LoadMetadataRepositoryJob.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/LoadMetadataRepositoryJob.java
@@ -68,7 +68,7 @@ public class LoadMetadataRepositoryJob extends ProvisioningJob {
*/
public static final QualifiedName ACCUMULATE_LOAD_ERRORS = new QualifiedName(ProvUIActivator.PLUGIN_ID, "ACCUMULATE_LOAD_ERRORS"); //$NON-NLS-1$
- private List<IMetadataRepository> repoCache = new ArrayList<IMetadataRepository>();
+ private List<IMetadataRepository> repoCache = new ArrayList<>();
private RepositoryTracker tracker;
private MultiStatus accumulatedStatus;
private URI[] locations;
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/RepositoryManipulationPage.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/RepositoryManipulationPage.java
index f77fa6a07..4cc1686b1 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/RepositoryManipulationPage.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/RepositoryManipulationPage.java
@@ -111,8 +111,8 @@ public class RepositoryManipulationPage extends PreferencePage implements IWorkb
WorkbenchJob filterJob;
Button addButton, removeButton, editButton, refreshButton, disableButton, exportButton;
- private Map<MetadataRepositoryElement, URI> originalURICache = new HashMap<MetadataRepositoryElement, URI>(2);
- private Map<MetadataRepositoryElement, String> originalNameCache = new HashMap<MetadataRepositoryElement, String>(2);
+ private Map<MetadataRepositoryElement, URI> originalURICache = new HashMap<>(2);
+ private Map<MetadataRepositoryElement, String> originalNameCache = new HashMap<>(2);
class CachedMetadataRepositories extends MetadataRepositories {
private Hashtable<String, MetadataRepositoryElement> cachedElements;
@@ -131,7 +131,7 @@ public class RepositoryManipulationPage extends PreferencePage implements IWorkb
public Object[] fetchChildren(Object o, IProgressMonitor monitor) {
if (cachedElements == null) {
Object[] children = super.fetchChildren(o, monitor);
- cachedElements = new Hashtable<String, MetadataRepositoryElement>(children.length);
+ cachedElements = new Hashtable<>(children.length);
for (int i = 0; i < children.length; i++) {
if (children[i] instanceof MetadataRepositoryElement) {
put((MetadataRepositoryElement) children[i]);
@@ -585,7 +585,7 @@ public class RepositoryManipulationPage extends PreferencePage implements IWorkb
MetadataRepositoryElement[] getSelectedElements() {
Object[] items = ((IStructuredSelection) repositoryViewer.getSelection()).toArray();
- ArrayList<Object> list = new ArrayList<Object>(items.length);
+ ArrayList<Object> list = new ArrayList<>(items.length);
for (int i = 0; i < items.length; i++) {
if (items[i] instanceof MetadataRepositoryElement)
list.add(items[i]);

Back to the top