diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java index de3e95c574..a03cf5a08e 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java @@ -1383,7 +1383,7 @@ public IQueryable descriptorQueryable() { synchronized (SimpleArtifactRepository.this) { snapshotNeeded = true; Collection> descs = SimpleArtifactRepository.this.artifactMap.values(); - return query.perform(new CompoundIterator(descs.iterator())); + return query.perform(new CompoundIterator<>(descs.iterator())); } }; } diff --git a/bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF index b819d8bb89..c6adf85358 100644 --- a/bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.equinox.p2.core;singleton:=true -Bundle-Version: 2.10.100.qualifier +Bundle-Version: 2.10.200.qualifier Bundle-Activator: org.eclipse.equinox.internal.p2.core.Activator Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/ProvisioningAgent.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/ProvisioningAgent.java index 11889073e9..85db1b2bdf 100644 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/ProvisioningAgent.java +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/ProvisioningAgent.java @@ -32,7 +32,8 @@ public class ProvisioningAgent implements IProvisioningAgent, ServiceTrackerCust private BundleContext context; private volatile boolean stopped = false; private ServiceRegistration reg; - private final Map, ServiceTracker> trackers = Collections.synchronizedMap(new HashMap, ServiceTracker>()); + private final Map, ServiceTracker> trackers = Collections + .synchronizedMap(new HashMap<>()); /** * Instantiates a provisioning agent. diff --git a/bundles/org.eclipse.equinox.p2.directorywatcher/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.directorywatcher/META-INF/MANIFEST.MF index e6ad5d3c1a..2718dee2c2 100644 --- a/bundles/org.eclipse.equinox.p2.directorywatcher/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.directorywatcher/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.equinox.p2.directorywatcher;singleton:=true -Bundle-Version: 1.4.100.qualifier +Bundle-Version: 1.4.200.qualifier Bundle-Vendor: %providerName Bundle-Localization: plugin Export-Package: org.eclipse.equinox.internal.provisional.p2.directorywatcher;x-friends:="org.eclipse.equinox.p2.reconciler.dropins,org.eclipse.equinox.p2.extensionlocation" diff --git a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java index cafc760562..45c46dc92e 100644 --- a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java +++ b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java @@ -394,7 +394,8 @@ public IArtifactKey createArtifactKey(String classifier, String id, Version vers @Override public IQueryable descriptorQueryable() { final Collection> descs = artifactMap.values(); - IQueryable cached = (query, monitor) -> query.perform(new CompoundIterator(descs.iterator())); + IQueryable cached = (query, monitor) -> query + .perform(new CompoundIterator<>(descs.iterator())); return QueryUtil.compoundQueryable(cached, innerRepo.descriptorQueryable()); } diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfilePreferences.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfilePreferences.java index 30cea5897b..45c4fb62b8 100644 --- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfilePreferences.java +++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfilePreferences.java @@ -70,7 +70,7 @@ protected IStatus run(IProgressMonitor monitor) { } // cache which nodes have been loaded from disk - private static Set loadedNodes = Collections.synchronizedSet(new HashSet()); + private static Set loadedNodes = Collections.synchronizedSet(new HashSet<>()); public static final Object PROFILE_SAVE_JOB_FAMILY = new Object(); diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/CheckTrust.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/CheckTrust.java index 5b81e7ba31..87384eba06 100644 --- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/CheckTrust.java +++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/CheckTrust.java @@ -93,7 +93,7 @@ protected IStatus initializeOperand(IProfile profile, InstallableUnitOperand ope @Override protected IStatus initializePhase(IProgressMonitor monitor, IProfile profile, Map parameters) { - parameters.put(PARM_ARTIFACTS, new HashMap()); + parameters.put(PARM_ARTIFACTS, new HashMap<>()); return super.initializePhase(monitor, profile, parameters); } diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Collect.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Collect.java index c8fb547c59..0c2237675d 100644 --- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Collect.java +++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Collect.java @@ -135,8 +135,8 @@ protected IStatus completePhase(IProgressMonitor monitor, IProfile profile, Map< @Override protected IStatus initializePhase(IProgressMonitor monitor, IProfile profile, Map parameters) { - parameters.put(PARM_ARTIFACT_REQUESTS, new ArrayList()); - parameters.put(PARM_IUS, new HashSet()); + parameters.put(PARM_ARTIFACT_REQUESTS, new ArrayList<>()); + parameters.put(PARM_IUS, new HashSet<>()); return null; } diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Sizing.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Sizing.java index 0e45359899..dc7c2e8915 100644 --- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Sizing.java +++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/phases/Sizing.java @@ -7,7 +7,7 @@ * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -131,7 +131,7 @@ protected IStatus completePhase(IProgressMonitor monitor, IProfile profile, Map< @Override protected IStatus initializePhase(IProgressMonitor monitor, IProfile profile, Map parameters) { - parameters.put(Collect.PARM_ARTIFACT_REQUESTS, new ArrayList()); + parameters.put(Collect.PARM_ARTIFACT_REQUESTS, new ArrayList<>()); return null; } diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/VersionFormat.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/VersionFormat.java index 1dc8925c46..6aec0ade3d 100644 --- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/VersionFormat.java +++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/VersionFormat.java @@ -14,16 +14,26 @@ package org.eclipse.equinox.internal.p2.metadata; import java.io.Serializable; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import org.eclipse.equinox.internal.p2.metadata.VersionFormatParser.Fragment; -import org.eclipse.equinox.p2.metadata.*; +import org.eclipse.equinox.p2.metadata.IVersionFormat; +import org.eclipse.equinox.p2.metadata.Version; +import org.eclipse.equinox.p2.metadata.VersionFormatException; import org.eclipse.osgi.util.NLS; /** - *

The VersionFormat represents the Omni Version Format in compiled form. It - * is also a parser for versions of that format.

- *

An instance of VersionFormat is immutable and thus thread safe. The parser - * does not maintain any state.

+ *

+ * The VersionFormat represents the Omni Version Format in compiled form. It is + * also a parser for versions of that format. + *

+ *

+ * An instance of VersionFormat is immutable and thus thread safe. The parser + * does not maintain any state. + *

* * @Immutable * @noextend This class is not intended to be subclassed by clients. @@ -31,12 +41,14 @@ public class VersionFormat implements IVersionFormat, Serializable { /** - * The string representation of the Omni Version format used for parsing OSGi versions. + * The string representation of the Omni Version format used for parsing OSGi + * versions. */ public static final String OSGI_FORMAT_STRING = "n[.n=0;[.n=0;[.S='';=[A-Za-z0-9_-];]]]"; //$NON-NLS-1$ /** - * The string representation of the Omni Version format used for parsing raw versions. + * The string representation of the Omni Version format used for parsing raw + * versions. */ public static final String RAW_FORMAT_STRING = "r(.r)*p?"; //$NON-NLS-1$ @@ -109,17 +121,15 @@ void setPosition(int pos) { } } - private static final Map formatCache = Collections.synchronizedMap(new HashMap()); + private static final Map formatCache = Collections.synchronizedMap(new HashMap<>()); /** - * The predefined OSGi format that is used when parsing OSGi - * versions. + * The predefined OSGi format that is used when parsing OSGi versions. */ public static final VersionFormat OSGI_FORMAT; /** - * The predefined OSGi format that is used when parsing raw - * versions. + * The predefined OSGi format that is used when parsing raw versions. */ public static final VersionFormat RAW_FORMAT; @@ -140,7 +150,13 @@ void setPosition(int pos) { /** * Compile a version format string into a compiled format. This method is - * shorthand for:
CompiledFormat.compile(format, 0, format.length())
. + * shorthand for: + * + *
+	 * CompiledFormat.compile(format, 0, format.length())
+	 * 
+ * + * . * * @param format The format to compile. * @return The compiled format @@ -151,14 +167,14 @@ public static IVersionFormat compile(String format) throws VersionFormatExceptio } /** - * Compile a version format string into a compiled format. The parsing starts - * at position start and ends at position end. The returned format is cached so + * Compile a version format string into a compiled format. The parsing starts at + * position start and ends at position end. The returned format is cached so * subsequent calls to this method using the same format string will yield the * same compiled format instance. * * @param format The format string to compile. - * @param start Start position in the format string - * @param end End position in the format string + * @param start Start position in the format string + * @param end End position in the format string * @return The compiled format * @throws VersionFormatException If the format could not be compiled */ @@ -178,15 +194,18 @@ public static VersionFormat compile(String format, int start, int end) throws Ve /** * Parse a version string using the {@link #RAW_FORMAT} parser. * - * @param version The version to parse. - * @param originalFormat The original format to assign to the created version. Can be null. - * @param original The original version string to assign to the created version. Can be null. + * @param version The version to parse. + * @param originalFormat The original format to assign to the created version. + * Can be null. + * @param original The original version string to assign to the created + * version. Can be null. * @return A created version * @throws IllegalArgumentException If the version string could not be parsed. */ public static BasicVersion parseRaw(String version, IVersionFormat originalFormat, String original) { List> vector = RAW_FORMAT.parse(version, 0, version.length()); - return (originalFormat == OSGI_FORMAT) ? OSGiVersion.fromVector(vector) : OmniVersion.fromVector(vector, originalFormat, original); + return (originalFormat == OSGI_FORMAT) ? OSGiVersion.fromVector(vector) + : OmniVersion.fromVector(vector, originalFormat, original); } static void rawToString(StringBuffer sb, boolean forRange, Comparable e) { @@ -203,19 +222,25 @@ static void rawToString(StringBuffer sb, boolean forRange, Comparable e) { } /** - * Write a string within quotes. If the string is found to contain the quote, an attempt is made - * to flip quote character (single quote becomes double quote and vice versa). A string that contains - * both will be written as several adjacent quoted strings so that each string is quoted with a - * quote character that it does not contain. - * @param sb The buffer that will receive the string - * @param rangeSafe Set to true if the resulting string will be used in a range string - * and hence need to escape the range delimiter characters - * @param s The string to be written - * @param quote The quote character to start with. Must be the single or double quote character. - * @param startPos The start position - * @param didFlip True if the call is recursive and thus, cannot switch quotes in the first string. + * Write a string within quotes. If the string is found to contain the quote, an + * attempt is made to flip quote character (single quote becomes double quote + * and vice versa). A string that contains both will be written as several + * adjacent quoted strings so that each string is quoted with a quote character + * that it does not contain. + * + * @param sb The buffer that will receive the string + * @param rangeSafe Set to true if the resulting string will be + * used in a range string and hence need to escape the range + * delimiter characters + * @param s The string to be written + * @param quote The quote character to start with. Must be the single or + * double quote character. + * @param startPos The start position + * @param didFlip True if the call is recursive and thus, cannot switch quotes + * in the first string. */ - private static void writeQuotedString(StringBuffer sb, boolean rangeSafe, String s, char quote, int startPos, boolean didFlip) { + private static void writeQuotedString(StringBuffer sb, boolean rangeSafe, String s, char quote, int startPos, + boolean didFlip) { int quotePos = sb.length(); sb.append(quote); boolean otherSeen = false; @@ -274,11 +299,13 @@ public Version parse(String version) { List> parse(String version, int start, int maxPos) { if (start == maxPos) - throw new IllegalArgumentException(NLS.bind(Messages.format_0_unable_to_parse_empty_version, this, version.substring(start, maxPos))); + throw new IllegalArgumentException( + NLS.bind(Messages.format_0_unable_to_parse_empty_version, this, version.substring(start, maxPos))); TreeInfo info = new TreeInfo(topFragment, start); ArrayList> entries = new ArrayList<>(5); if (!(topFragment.parse(entries, version, maxPos, info) && info.getPosition() == maxPos)) - throw new IllegalArgumentException(NLS.bind(Messages.format_0_unable_to_parse_1, this, version.substring(start, maxPos))); + throw new IllegalArgumentException( + NLS.bind(Messages.format_0_unable_to_parse_1, this, version.substring(start, maxPos))); entries.add(VersionParser.removeRedundantTrail(entries, info.getPadValue())); return entries; } diff --git a/bundles/org.eclipse.equinox.p2.operations/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.operations/META-INF/MANIFEST.MF index 0da041d2e8..73ff23f097 100644 --- a/bundles/org.eclipse.equinox.p2.operations/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.operations/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.equinox.p2.operations;singleton:=true -Bundle-Version: 2.7.100.qualifier +Bundle-Version: 2.7.200.qualifier Bundle-Vendor: %providerName Bundle-Localization: plugin Export-Package: org.eclipse.equinox.internal.p2.operations;x-friends:="org.eclipse.pde.ui,org.eclipse.equinox.p2.ui", diff --git a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProvisioningSession.java b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProvisioningSession.java index e3ff8ba124..b597b82c6c 100644 --- a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProvisioningSession.java +++ b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProvisioningSession.java @@ -47,7 +47,7 @@ public class ProvisioningSession { private IProvisioningAgent agent; - Set scheduledJobs = Collections.synchronizedSet(new HashSet()); + Set scheduledJobs = Collections.synchronizedSet(new HashSet<>()); /** * Create a provisioning session using the services of the supplied agent. @@ -149,9 +149,8 @@ public IStatus performProvisioningPlan(IProvisioningPlan plan, IPhaseSet phaseSe // at the same time as the actual install artifacts. This way, we will only install the install handler // after already knowing we have successfully obtained the artifacts that will be installed afterward. IProvisioningPlan downloadPlan = getEngine().createPlan(profile, context); - Iterator it = QueryUtil.compoundQueryable(plan.getAdditions(), plan.getInstallerPlan().getAdditions()).query(QueryUtil.createIUAnyQuery(), null).iterator(); - while (it.hasNext()) { - downloadPlan.addInstallableUnit(it.next()); + for (IInstallableUnit element : QueryUtil.compoundQueryable(plan.getAdditions(), plan.getInstallerPlan().getAdditions()).query(QueryUtil.createIUAnyQuery(), null)) { + downloadPlan.addInstallableUnit(element); } IPhaseSet download = PhaseSetFactory.createPhaseSetIncluding(new String[] {PhaseSetFactory.PHASE_COLLECT}); IStatus downloadStatus = getEngine().perform(downloadPlan, download, mon.newChild(300)); diff --git a/bundles/org.eclipse.equinox.p2.publisher.eclipse/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.publisher.eclipse/META-INF/MANIFEST.MF index ff2abcdeed..de94c0b13f 100644 --- a/bundles/org.eclipse.equinox.p2.publisher.eclipse/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.publisher.eclipse/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %bundleName Bundle-SymbolicName: org.eclipse.equinox.p2.publisher.eclipse;singleton:=true -Bundle-Version: 1.5.100.qualifier +Bundle-Version: 1.5.200.qualifier Bundle-Activator: org.eclipse.pde.internal.publishing.Activator Bundle-ActivationPolicy: lazy Bundle-Vendor: %providerName diff --git a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/BundlesAction.java b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/BundlesAction.java index 1702362278..771d592045 100644 --- a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/BundlesAction.java +++ b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/BundlesAction.java @@ -866,7 +866,7 @@ public static Dictionary basicLoadManifest(File bundleLocation) private static Headers parseBundleManifestIntoModifyableDictionaryWithCaseInsensitiveKeys( InputStream manifestStream) throws IOException, BundleException { return (Headers) ManifestElement.parseBundleManifest(manifestStream, - new Headers(10)); + new Headers<>(10)); } private static ManifestElement[] parseManifestHeader(String header, Map manifest, diff --git a/bundles/org.eclipse.equinox.p2.tests.discovery/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.tests.discovery/META-INF/MANIFEST.MF index 3632352fc0..7ad55358eb 100644 --- a/bundles/org.eclipse.equinox.p2.tests.discovery/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.tests.discovery/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.eclipse.equinox.p2.tests.discovery;singleton:=true -Bundle-Version: 1.4.200.qualifier +Bundle-Version: 1.4.300.qualifier Bundle-Vendor: %Bundle-Vendor Bundle-Localization: plugin Export-Package: org.eclipse.equinox.p2.discovery.tests;x-internal:=true, diff --git a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/RemoteBundleDiscoveryStrategyTest.java b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/RemoteBundleDiscoveryStrategyTest.java index 98946fb8e8..266418d8c9 100644 --- a/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/RemoteBundleDiscoveryStrategyTest.java +++ b/bundles/org.eclipse.equinox.p2.tests.discovery/src/org/eclipse/equinox/p2/discovery/tests/core/RemoteBundleDiscoveryStrategyTest.java @@ -23,7 +23,8 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.equinox.internal.p2.discovery.compatibility.RemoteBundleDiscoveryStrategy; -import org.eclipse.equinox.internal.p2.discovery.model.*; +import org.eclipse.equinox.internal.p2.discovery.model.CatalogCategory; +import org.eclipse.equinox.internal.p2.discovery.model.CatalogItem; import org.eclipse.equinox.p2.discovery.tests.DiscoveryTestConstants; import org.junit.Before; import org.junit.Test; @@ -39,10 +40,10 @@ public class RemoteBundleDiscoveryStrategyTest { public void setUp() throws Exception { discoveryStrategy = new RemoteBundleDiscoveryStrategy(); discoveryStrategy.setDirectoryUrl(DiscoveryTestConstants.DISCOVERY_URL); - discoveryStrategy.setCategories(new ArrayList()); - discoveryStrategy.setItems(new ArrayList()); - discoveryStrategy.setCertifications(new ArrayList()); - discoveryStrategy.setTags(new ArrayList()); + discoveryStrategy.setCategories(new ArrayList<>()); + discoveryStrategy.setItems(new ArrayList<>()); + discoveryStrategy.setCertifications(new ArrayList<>()); + discoveryStrategy.setTags(new ArrayList<>()); } @Test diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug278668.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug278668.java index b92336c4a5..db96f85a09 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug278668.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug278668.java @@ -17,8 +17,15 @@ import java.util.HashMap; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.equinox.internal.p2.director.ProfileChangeRequest; -import org.eclipse.equinox.p2.engine.*; -import org.eclipse.equinox.p2.metadata.*; +import org.eclipse.equinox.p2.engine.IEngine; +import org.eclipse.equinox.p2.engine.IProfile; +import org.eclipse.equinox.p2.engine.IProvisioningPlan; +import org.eclipse.equinox.p2.metadata.IInstallableUnit; +import org.eclipse.equinox.p2.metadata.IProvidedCapability; +import org.eclipse.equinox.p2.metadata.IRequirement; +import org.eclipse.equinox.p2.metadata.MetadataFactory; +import org.eclipse.equinox.p2.metadata.Version; +import org.eclipse.equinox.p2.metadata.VersionRange; import org.eclipse.equinox.p2.planner.IPlanner; import org.eclipse.equinox.p2.planner.ProfileInclusionRules; import org.eclipse.equinox.p2.query.IQueryResult; @@ -60,7 +67,12 @@ protected void setUp() throws Exception { requirements.add(MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, "com.tssap.selena.model.providers.resources", new VersionRange("[1.0.0, 1.0.0]"), null, false, false)); requirements.add(MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, "com.tssap.selena.model", new VersionRange("[1.0.0, 1.0.0]"), null, false, false)); - IInstallableUnit group = createIU("com.borland.tg.modeling.feature.group", Version.create("8.2.0.v20081113-0500-_87S7nELRXmpf6G0dO3emm"), null, requirements.toArray(new IRequirement[requirements.size()]), new IProvidedCapability[] {MetadataFactory.createProvidedCapability(IInstallableUnit.NAMESPACE_IU_ID, "com.borland.tg.modeling", Version.create("8.2.0.v20081113-0500-_87S7nELRXmpf6G0dO3emm"))}, new HashMap(), null, null, true); + IInstallableUnit group = createIU("com.borland.tg.modeling.feature.group", + Version.create("8.2.0.v20081113-0500-_87S7nELRXmpf6G0dO3emm"), null, + requirements.toArray(new IRequirement[requirements.size()]), + new IProvidedCapability[] { MetadataFactory.createProvidedCapability(IInstallableUnit.NAMESPACE_IU_ID, + "com.borland.tg.modeling", Version.create("8.2.0.v20081113-0500-_87S7nELRXmpf6G0dO3emm")) }, + new HashMap<>(), null, null, true); ProfileChangeRequest req = new ProfileChangeRequest(profile); req.addInstallableUnits(new IInstallableUnit[] {group}); diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/FindingPatchesThroughUpdates.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/FindingPatchesThroughUpdates.java index 5ebdde5daa..4ef9d695f5 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/FindingPatchesThroughUpdates.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/FindingPatchesThroughUpdates.java @@ -15,8 +15,17 @@ import java.util.HashMap; import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.equinox.p2.engine.*; -import org.eclipse.equinox.p2.metadata.*; +import org.eclipse.equinox.p2.engine.IEngine; +import org.eclipse.equinox.p2.engine.IProfile; +import org.eclipse.equinox.p2.engine.ProvisioningContext; +import org.eclipse.equinox.p2.metadata.IInstallableUnit; +import org.eclipse.equinox.p2.metadata.IInstallableUnitPatch; +import org.eclipse.equinox.p2.metadata.IRequirement; +import org.eclipse.equinox.p2.metadata.IRequirementChange; +import org.eclipse.equinox.p2.metadata.IUpdateDescriptor; +import org.eclipse.equinox.p2.metadata.MetadataFactory; +import org.eclipse.equinox.p2.metadata.Version; +import org.eclipse.equinox.p2.metadata.VersionRange; import org.eclipse.equinox.p2.planner.IPlanner; import org.eclipse.equinox.p2.query.IQueryResult; import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; @@ -51,7 +60,13 @@ protected void setUp() throws Exception { IRequirementChange change4 = MetadataFactory.createRequirementChange(MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, "B", VersionRange.emptyRange, null, false, false, false), MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, "B", new VersionRange("[1.1.0, 1.3.0)"), null, false, false, true)); IRequirement lifeCycle4 = MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, "A", new VersionRange("[2.0.0, 3.2.0]"), null, false, false); - anotherPatch3 = createIUPatch("ANOTHERPATCH", Version.create("2.0.0"), null, NO_REQUIRES, NO_PROVIDES, new HashMap(), null, null, true, MetadataFactory.createUpdateDescriptor("ANOTHERPATCH", new VersionRange("[1.0.0, 1.0.0]"), 0, ""), new IRequirementChange[] {change4}, new IRequirement[][] {{MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, "A", VersionRange.emptyRange, null, false, false)}}, lifeCycle4, NO_REQUIRES); + anotherPatch3 = createIUPatch("ANOTHERPATCH", Version.create("2.0.0"), null, NO_REQUIRES, NO_PROVIDES, + new HashMap<>(), null, null, true, + MetadataFactory.createUpdateDescriptor("ANOTHERPATCH", new VersionRange("[1.0.0, 1.0.0]"), 0, ""), + new IRequirementChange[] { change4 }, + new IRequirement[][] { { MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, "A", + VersionRange.emptyRange, null, false, false) } }, + lifeCycle4, NO_REQUIRES); createTestMetdataRepository(new IInstallableUnit[] {a1, a120, patchA1, patchA2, anotherPatch2, anotherPatch3}); diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/TychoUsage.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/TychoUsage.java index 08701b2993..edcf5fa72d 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/TychoUsage.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/TychoUsage.java @@ -74,8 +74,8 @@ public void testTychoUsage() throws ProvisionException, URISyntaxException { Slicer slicer = new Slicer(repo, context, false); IQueryable slice = slicer.slice(new IInstallableUnit[] {topLevelIU}, new NullProgressMonitor()); - Projector p = new Projector(slice, context, new HashSet(), false); - p.encode(topLevelIU, new IInstallableUnit[0], new Collector(), newRoots, new NullProgressMonitor()); + Projector p = new Projector(slice, context, new HashSet<>(), false); + p.encode(topLevelIU, new IInstallableUnit[0], new Collector<>(), newRoots, new NullProgressMonitor()); IStatus result = p.invokeSolver(new NullProgressMonitor()); assertTrue(result.isOK() || result.getSeverity() == IStatus.WARNING); assertFalse(p.extractSolution().isEmpty()); diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/ProfileSynchronizerTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/ProfileSynchronizerTest.java index fcdbc7467b..5781ff1fda 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/ProfileSynchronizerTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/ProfileSynchronizerTest.java @@ -27,7 +27,6 @@ import org.eclipse.equinox.p2.engine.query.IUProfilePropertyQuery; import org.eclipse.equinox.p2.metadata.IInstallableUnit; import org.eclipse.equinox.p2.query.QueryUtil; -import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository; import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; import org.eclipse.equinox.p2.tests.TestActivator; @@ -63,7 +62,7 @@ public void testPropertyAreProperlyPutBack() throws IllegalArgumentException { assertFalse(sdkProfile.query(QueryUtil.createIUQuery("aniefer.junit.headless"), null).isEmpty()); int originalSize = sdkProfile.query(QueryUtil.ALL_UNITS, null).toUnmodifiableSet().size(); - ProfileSynchronizer sync = new ProfileSynchronizer(agent, sdkProfile, new ArrayList()); + ProfileSynchronizer sync = new ProfileSynchronizer(agent, sdkProfile, new ArrayList<>()); sync.synchronize(null); Set newRoots = registry.getProfile("SDKProfile").query(new IUProfilePropertyQuery("org.eclipse.equinox.p2.type.root", Boolean.TRUE.toString()), null).toSet(); newRoots.removeAll(oldRoots); diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/ProfileSynchronizerTest2.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/ProfileSynchronizerTest2.java index 2e87190abf..a4cf00fe31 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/ProfileSynchronizerTest2.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/ProfileSynchronizerTest2.java @@ -27,7 +27,6 @@ import org.eclipse.equinox.p2.engine.query.IUProfilePropertyQuery; import org.eclipse.equinox.p2.metadata.IInstallableUnit; import org.eclipse.equinox.p2.query.QueryUtil; -import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository; import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; import org.eclipse.equinox.p2.tests.TestActivator; @@ -62,7 +61,7 @@ public void testRemovalOfStrictRoot() throws IllegalArgumentException { Set oldRoots = sdkProfile.query(new IUProfilePropertyQuery("org.eclipse.equinox.p2.type.root", Boolean.TRUE.toString()), null).toUnmodifiableSet(); assertFalse("could not find gmf", sdkProfile.query(QueryUtil.createIUQuery("org.eclipse.gmf.sdk.feature.group"), null).isEmpty()); - ProfileSynchronizer sync = new ProfileSynchronizer(agent, sdkProfile, new ArrayList()); + ProfileSynchronizer sync = new ProfileSynchronizer(agent, sdkProfile, new ArrayList<>()); sync.synchronize(null); Set newRoots = registry.getProfile("SDKProfile").query(new IUProfilePropertyQuery("org.eclipse.equinox.p2.type.root", Boolean.TRUE.toString()), null).toSet(); newRoots.removeAll(oldRoots); 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 38f720e928..012d4e4c71 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 @@ -14,7 +14,11 @@ package org.eclipse.equinox.p2.tests.touchpoint.eclipse; import java.io.File; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import org.eclipse.equinox.internal.p2.engine.InstallableUnitOperand; import org.eclipse.equinox.internal.p2.engine.phases.Collect; import org.eclipse.equinox.internal.p2.touchpoint.eclipse.EclipseTouchpoint; @@ -65,7 +69,7 @@ public void testExecuteUndo() throws Exception { Map parameters = new HashMap<>(); parameters.put(ActionConstants.PARM_AGENT, getAgent()); parameters.put(ActionConstants.PARM_PROFILE, profile); - parameters.put(Collect.PARM_ARTIFACT_REQUESTS, new ArrayList()); + parameters.put(Collect.PARM_ARTIFACT_REQUESTS, new ArrayList<>()); EclipseTouchpoint touchpoint = new EclipseTouchpoint(); touchpoint.initializePhase(null, profile, "test", parameters); InstallableUnitOperand operand = new InstallableUnitOperand(null, iu); 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 81b3917814..d50699f287 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 @@ -14,13 +14,19 @@ package org.eclipse.equinox.p2.tests.touchpoint.natives; import java.io.File; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import org.eclipse.equinox.internal.p2.engine.phases.Collect; import org.eclipse.equinox.internal.p2.touchpoint.natives.NativeTouchpoint; import org.eclipse.equinox.internal.p2.touchpoint.natives.actions.ActionConstants; import org.eclipse.equinox.internal.p2.touchpoint.natives.actions.CollectAction; import org.eclipse.equinox.p2.engine.IProfile; -import org.eclipse.equinox.p2.metadata.*; +import org.eclipse.equinox.p2.metadata.IArtifactKey; +import org.eclipse.equinox.p2.metadata.IInstallableUnit; +import org.eclipse.equinox.p2.metadata.MetadataFactory; import org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription; import org.eclipse.equinox.p2.repository.artifact.IArtifactRequest; import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; @@ -57,7 +63,7 @@ public void testExecuteUndo() { Map parameters = new HashMap<>(); parameters.put(ActionConstants.PARM_AGENT, getAgent()); parameters.put(ActionConstants.PARM_PROFILE, profile); - parameters.put(Collect.PARM_ARTIFACT_REQUESTS, new ArrayList()); + parameters.put(Collect.PARM_ARTIFACT_REQUESTS, new ArrayList<>()); NativeTouchpoint touchpoint = new NativeTouchpoint(); touchpoint.initializePhase(null, profile, "test", parameters); parameters.put("iu", iu); diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.ui.importexport/META-INF/MANIFEST.MF index c0a4fc4800..c06377a9c6 100755 --- a/bundles/org.eclipse.equinox.p2.ui.importexport/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.ui.importexport/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.equinox.p2.ui.importexport;singleton:=true -Bundle-Version: 1.4.100.qualifier +Bundle-Version: 1.4.200.qualifier Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)", diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportWizard.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportWizard.java index 22a8b19058..1eb6d36d01 100644 --- a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportWizard.java +++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportWizard.java @@ -105,7 +105,7 @@ public void recomputePlan(IRunnableContext runnableContext, final boolean withRe initializeResolutionModelElements(getOperationSelections()); if (planSelections.length == 0) { operation = new InstallOperation(new ProvisioningSession(AbstractPage.agent), - new ArrayList()) { + new ArrayList<>()) { @Override protected void computeProfileChangeRequest(MultiStatus status, IProgressMonitor progressMonitor) { @@ -138,8 +138,7 @@ public IStatus getResolutionResult() { Display.getDefault().asyncExec(this::planChanged); }); } catch (InterruptedException e) { - operation = new InstallOperation(new ProvisioningSession(AbstractPage.agent), - new ArrayList()) { + operation = new InstallOperation(new ProvisioningSession(AbstractPage.agent), new ArrayList<>()) { @Override public IStatus getResolutionResult() { diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.simpleconfigurator/META-INF/MANIFEST.MF index 3704bace66..9d5bba8f06 100644 --- a/bundles/org.eclipse.equinox.simpleconfigurator/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.simpleconfigurator/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.equinox.simpleconfigurator;singleton:=true -Bundle-Version: 1.4.300.qualifier +Bundle-Version: 1.4.400.qualifier Bundle-Name: %bundleName Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/SimpleConfiguratorUtils.java b/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/SimpleConfiguratorUtils.java index 0a24d2b75f..5a16c4eaa7 100644 --- a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/SimpleConfiguratorUtils.java +++ b/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/SimpleConfiguratorUtils.java @@ -38,7 +38,7 @@ public class SimpleConfiguratorUtils { private static final String COMMA = ","; private static final String ENCODED_COMMA = "%2C"; - private static final Set reportedExtensions = Collections.synchronizedSet(new HashSet(0)); + private static final Set reportedExtensions = Collections.synchronizedSet(new HashSet<>(0)); public static List readConfiguration(URL url, URI base) throws IOException { List result = new ArrayList<>();