From aa4840ff474976da781a066cabb4eb5029f2790c Mon Sep 17 00:00:00 2001 From: Andrey Loskutov Date: Wed, 10 May 2023 13:42:00 +0200 Subject: [PATCH] Fix for "Redundant specification of type arguments" error See https://github.com/eclipse-platform/eclipse.platform/issues/444 --- .../eclipse/equinox/internal/p2/ui/QueryProvider.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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 699b8d1205..aca5c6ec0b 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 @@ -14,7 +14,6 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.ui; -import java.net.URI; import java.util.*; import org.eclipse.equinox.internal.p2.metadata.InstallableUnit; import org.eclipse.equinox.internal.p2.ui.model.*; @@ -100,7 +99,7 @@ public ElementQueryDescriptor getQueryDescriptor(final QueriedElement element) { switch (queryType) { case ARTIFACT_REPOS : queryable = new QueryableArtifactRepositoryManager(ui, false).locationsQueriable(); - return new ElementQueryDescriptor(queryable, new RepositoryLocationQuery(), new Collector(), new ArtifactRepositoryElementWrapper(null, element)); + return new ElementQueryDescriptor(queryable, new RepositoryLocationQuery(), new Collector<>(), new ArtifactRepositoryElementWrapper(null, element)); case AVAILABLE_IUS : // Things get more complicated if the user wants to filter out installed items. @@ -206,12 +205,12 @@ public ElementQueryDescriptor getQueryDescriptor(final QueriedElement element) { IQuery meetsAnyRequirementQuery = QueryUtil.createMatchQuery(factory.or(requirementExpressions)); IQuery visibleAsAvailableQuery = policy.getVisibleAvailableIUQuery(); IQuery createCompoundQuery = QueryUtil.createCompoundQuery(visibleAsAvailableQuery, meetsAnyRequirementQuery, true); - return new ElementQueryDescriptor(queryable, createCompoundQuery, new Collector(), new InstalledIUElementWrapper(queryable, element)); + return new ElementQueryDescriptor(queryable, createCompoundQuery, new Collector<>(), new InstalledIUElementWrapper(queryable, element)); } profile = ProvUI.getAdapter(element, IProfile.class); if (profile == null) return null; - return new ElementQueryDescriptor(profile, policy.getVisibleInstalledIUQuery(), new Collector(), new InstalledIUElementWrapper(profile, element)); + return new ElementQueryDescriptor(profile, policy.getVisibleInstalledIUQuery(), new Collector<>(), new InstalledIUElementWrapper(profile, element)); case METADATA_REPOS : if (element instanceof MetadataRepositories) { @@ -219,7 +218,7 @@ public ElementQueryDescriptor getQueryDescriptor(final QueriedElement element) { queryable = new QueryableMetadataRepositoryManager(ui, ((MetadataRepositories) element).getIncludeDisabledRepositories()).locationsQueriable(); element.setQueryable(queryable); } - return new ElementQueryDescriptor(element.getQueryable(), new RepositoryLocationQuery(), new Collector(), new MetadataRepositoryElementWrapper(null, element)); + return new ElementQueryDescriptor(element.getQueryable(), new RepositoryLocationQuery(), new Collector<>(), new MetadataRepositoryElementWrapper(null, element)); } return null;