Bug 574850 - [Clean-up] Remove generic type arguments where possible (2)

Use the regex "\.\<.*\(" to finds locations in java files where generic
type arguments are specified in method calls.
And use Sonar-Lint Eclipse plug-in to find remaining locations where the
diamond operator can be used.

Change-Id: I8d751b2fa833439d217909efc97096ec093793be
Signed-off-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
Reviewed-on: https://git.eclipse.org/r/c/equinox/rt.equinox.framework/+/183106
Reviewed-by: Lars Vogel <Lars.Vogel@vogella.com>
Tested-by: Equinox Bot <equinox-bot@eclipse.org>
diff --git a/bundles/org.eclipse.osgi.compatibility.state/META-INF/MANIFEST.MF b/bundles/org.eclipse.osgi.compatibility.state/META-INF/MANIFEST.MF
index 108e999..3bab840 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.osgi.compatibility.state/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-SymbolicName: org.eclipse.osgi.compatibility.state
-Bundle-Version: 1.2.400.qualifier
+Bundle-Version: 1.2.500.qualifier
 ExtensionBundle-Activator: org.eclipse.osgi.compatibility.state.Activator
 Fragment-Host: org.eclipse.osgi;bundle-version="3.12.0"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/bundles/org.eclipse.osgi.compatibility.state/pom.xml b/bundles/org.eclipse.osgi.compatibility.state/pom.xml
index 3b44110..81c39d8 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/pom.xml
+++ b/bundles/org.eclipse.osgi.compatibility.state/pom.xml
@@ -19,6 +19,6 @@
   </parent>
   <groupId>org.eclipse.osgi</groupId>
   <artifactId>org.eclipse.osgi.compatibility.state</artifactId>
-  <version>1.2.400-SNAPSHOT</version>
+  <version>1.2.500-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 </project>
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/GroupingChecker.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/GroupingChecker.java
index 9d4248b..fdccbf3 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/GroupingChecker.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/GroupingChecker.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2016 IBM Corporation and others.
+ * Copyright (c) 2004, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License 2.0 which accompanies this distribution,
@@ -12,7 +12,10 @@
  ******************************************************************************/
 package org.eclipse.osgi.internal.module;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 import org.eclipse.osgi.service.resolver.BundleSpecification;
 import org.eclipse.osgi.service.resolver.ExportPackageDescription;
 
@@ -40,7 +43,7 @@
 		for (BundleConstraint require : requires) {
 			ResolverBundle selectedSupplier = (ResolverBundle) require.getSelectedSupplier();
 			if (selectedSupplier != null)
-				isConsistentInternal(bundle, selectedSupplier, new ArrayList<ResolverBundle>(1), true, null);
+				isConsistentInternal(bundle, selectedSupplier, new ArrayList<>(1), true, null);
 		}
 		// process all imports
 		// must check resolved imports to get any dynamically resolved imports
@@ -71,7 +74,7 @@
 	 * If an inconsistency is found the export inconsistency is returned; otherwise null is returned
 	 */
 	public PackageRoots[][] isConsistent(ResolverBundle requiringBundle, ResolverBundle matchingBundle) {
-		List<PackageRoots[]> results = isConsistentInternal(requiringBundle, matchingBundle, new ArrayList<ResolverBundle>(1), false, null);
+		List<PackageRoots[]> results = isConsistentInternal(requiringBundle, matchingBundle, new ArrayList<>(1), false, null);
 		return results == null ? null : results.toArray(new PackageRoots[results.size()][]);
 	}
 
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/MappedList.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/MappedList.java
index 8d4bb5b..0a9d7ad 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/MappedList.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/MappedList.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2016 IBM Corporation and others.
+ * Copyright (c) 2005, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,11 @@
  *******************************************************************************/
 package org.eclipse.osgi.internal.module;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
 
 /*
  * A MappedList maps values into keyed list arrays.  All values with the same key are stored
@@ -23,7 +27,7 @@
 public class MappedList<K, V> {
 	// the mapping with key -> Object[] mapping
 	protected final HashMap<K, List<V>> internal = new HashMap<>();
-	protected final List<V> empty = Collections.<V> emptyList();
+	protected final List<V> empty = Collections.emptyList();
 
 	public void put(K key, V value) {
 		List<V> existing = internal.get(key);
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/ResolverImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/ResolverImpl.java
index 7cd4e67..89de26d 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/ResolverImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/ResolverImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2020 IBM Corporation and others.
+ * Copyright (c) 2004, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License 2.0 which accompanies this distribution,
@@ -423,7 +423,7 @@
 			if (!(StateImpl.OSGI_EE_NAMESPACE.equals(requirement.getNameSpace()) || requirement.isEffective()))
 				continue;
 			{
-				if (!resolveGenericReq(requirement, new ArrayList<ResolverBundle>(0))) {
+				if (!resolveGenericReq(requirement, new ArrayList<>(0))) {
 					if (DEBUG || DEBUG_GENERICS)
 						ResolverImpl.log("** GENERICS " + requirement.getVersionConstraint().getName() + "[" + requirement.getBundleDescription() + "] failed to resolve"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 					state.addResolverError(requirement.getVersionConstraint().getBundle(), ResolverError.MISSING_GENERIC_CAPABILITY, requirement.getVersionConstraint().toString(), requirement.getVersionConstraint());
@@ -2104,7 +2104,7 @@
 			if (!requestedPackage.equals(dynamicImport.getName()))
 				return null;
 
-			if (resolveImport(dynamicImport, new ArrayList<ResolverBundle>())) {
+			if (resolveImport(dynamicImport, new ArrayList<>())) {
 				// populate the grouping checker with current imports
 				groupingChecker.populateRoots(dynamicImport.getBundle());
 				while (dynamicImport.getSelectedSupplier() != null) {
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleDescriptionImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleDescriptionImpl.java
index 0c6d04e..a1f3d16 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleDescriptionImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleDescriptionImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2020 IBM Corporation and others.
+ * Copyright (c) 2003, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -1218,7 +1218,7 @@
 		public List<BundleWire> getRequiredWires(String namespace) {
 			if (!isInUse())
 				return null;
-			List<BundleWire> result = Collections.<BundleWire> emptyList();
+			List<BundleWire> result = Collections.emptyList();
 			Map<String, List<StateWire>> wireMap = getWires();
 			if (namespace == null) {
 				result = new ArrayList<>();
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleSpecificationImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleSpecificationImpl.java
index d0e449f..e213663 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleSpecificationImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleSpecificationImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2016 IBM Corporation and others.
+ * Copyright (c) 2003, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -14,8 +14,12 @@
  *******************************************************************************/
 package org.eclipse.osgi.internal.resolver;
 
-import java.util.*;
-import org.eclipse.osgi.service.resolver.*;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import org.eclipse.osgi.service.resolver.BaseDescription;
+import org.eclipse.osgi.service.resolver.BundleSpecification;
+import org.eclipse.osgi.service.resolver.VersionRange;
 import org.osgi.framework.Constants;
 import org.osgi.framework.wiring.BundleRevision;
 
@@ -153,7 +157,7 @@
 
 	@Override
 	protected Map<String, Object> getInteralAttributes() {
-		return Collections.<String, Object> emptyMap();
+		return Collections.emptyMap();
 	}
 
 	@Override
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/GenericDescriptionImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/GenericDescriptionImpl.java
index aba9d62..9818dc3 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/GenericDescriptionImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/GenericDescriptionImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2016 IBM Corporation and others.
+ * Copyright (c) 2006, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -14,8 +14,16 @@
  *******************************************************************************/
 package org.eclipse.osgi.internal.resolver;
 
-import java.util.*;
-import org.eclipse.osgi.service.resolver.*;
+import java.util.Collections;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+import org.eclipse.osgi.service.resolver.BaseDescription;
+import org.eclipse.osgi.service.resolver.BundleDescription;
+import org.eclipse.osgi.service.resolver.GenericDescription;
 import org.osgi.framework.Constants;
 import org.osgi.framework.Version;
 
@@ -117,7 +125,7 @@
 	public Map<String, String> getDeclaredDirectives() {
 		synchronized (this.monitor) {
 			if (directives == null)
-				return Collections.<String, String> emptyMap();
+				return Collections.emptyMap();
 			return Collections.unmodifiableMap(directives);
 		}
 	}
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/GenericSpecificationImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/GenericSpecificationImpl.java
index 086e921..3f8db62 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/GenericSpecificationImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/GenericSpecificationImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2016 IBM Corporation and others.
+ * Copyright (c) 2006, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -14,10 +14,16 @@
  *******************************************************************************/
 package org.eclipse.osgi.internal.resolver;
 
-import java.util.*;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
 import org.eclipse.osgi.internal.framework.FilterImpl;
-import org.eclipse.osgi.service.resolver.*;
-import org.osgi.framework.*;
+import org.eclipse.osgi.service.resolver.BaseDescription;
+import org.eclipse.osgi.service.resolver.GenericDescription;
+import org.eclipse.osgi.service.resolver.GenericSpecification;
+import org.osgi.framework.Constants;
+import org.osgi.framework.Filter;
+import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.resource.Namespace;
 
 public class GenericSpecificationImpl extends VersionConstraintImpl implements GenericSpecification {
@@ -195,7 +201,7 @@
 	@Override
 	protected Map<String, Object> getInteralAttributes() {
 		synchronized (this.monitor) {
-			return attributes == null ? Collections.<String, Object> emptyMap() : new HashMap<>(attributes);
+			return attributes == null ? Collections.emptyMap() : new HashMap<>(attributes);
 		}
 	}
 
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/HostSpecificationImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/HostSpecificationImpl.java
index 0ae911c..72421e5 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/HostSpecificationImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/HostSpecificationImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2016 IBM Corporation and others.
+ * Copyright (c) 2003, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -15,8 +15,13 @@
 
 package org.eclipse.osgi.internal.resolver;
 
-import java.util.*;
-import org.eclipse.osgi.service.resolver.*;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import org.eclipse.osgi.service.resolver.BaseDescription;
+import org.eclipse.osgi.service.resolver.BundleDescription;
+import org.eclipse.osgi.service.resolver.HostSpecification;
+import org.eclipse.osgi.service.resolver.VersionRange;
 import org.osgi.framework.Constants;
 import org.osgi.framework.wiring.BundleRevision;
 
@@ -170,7 +175,7 @@
 
 	@Override
 	protected Map<String, Object> getInteralAttributes() {
-		return Collections.<String, Object> emptyMap();
+		return Collections.emptyMap();
 	}
 
 	@Override
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/ImportPackageSpecificationImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/ImportPackageSpecificationImpl.java
index 47c9f1c..ab363a7 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/ImportPackageSpecificationImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/ImportPackageSpecificationImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2016 IBM Corporation and others.
+ * Copyright (c) 2003, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -15,9 +15,15 @@
  *******************************************************************************/
 package org.eclipse.osgi.internal.resolver;
 
-import java.util.*;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
 import org.eclipse.osgi.internal.framework.EquinoxContainer;
-import org.eclipse.osgi.service.resolver.*;
+import org.eclipse.osgi.service.resolver.BaseDescription;
+import org.eclipse.osgi.service.resolver.BundleDescription;
+import org.eclipse.osgi.service.resolver.ExportPackageDescription;
+import org.eclipse.osgi.service.resolver.ImportPackageSpecification;
+import org.eclipse.osgi.service.resolver.VersionRange;
 import org.osgi.framework.Constants;
 import org.osgi.framework.wiring.BundleRevision;
 
@@ -258,7 +264,7 @@
 
 	@Override
 	protected Map<String, Object> getInteralAttributes() {
-		return Collections.<String, Object> emptyMap();
+		return Collections.emptyMap();
 	}
 
 	@Override
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeDescriptionImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeDescriptionImpl.java
index 8f6a193..ef8fb25 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeDescriptionImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeDescriptionImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007, 2013 IBM Corporation and others.
+ * Copyright (c) 2007, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -14,11 +14,18 @@
  *******************************************************************************/
 package org.eclipse.osgi.internal.resolver;
 
-import java.util.*;
+import java.util.Collections;
+import java.util.Dictionary;
+import java.util.Map;
 import org.eclipse.osgi.internal.framework.FilterImpl;
-import org.eclipse.osgi.service.resolver.*;
+import org.eclipse.osgi.service.resolver.BundleDescription;
+import org.eclipse.osgi.service.resolver.NativeCodeDescription;
+import org.eclipse.osgi.service.resolver.State;
 import org.eclipse.osgi.service.resolver.VersionRange;
-import org.osgi.framework.*;
+import org.osgi.framework.Constants;
+import org.osgi.framework.Filter;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.Version;
 
 public class NativeCodeDescriptionImpl extends BaseDescriptionImpl implements NativeCodeDescription {
 	private static final VersionRange[] EMPTY_VERSIONRANGES = new VersionRange[0];
@@ -213,10 +220,10 @@
 	}
 
 	public Map<String, String> getDeclaredDirectives() {
-		return Collections.<String, String> emptyMap();
+		return Collections.emptyMap();
 	}
 
 	public Map<String, Object> getDeclaredAttributes() {
-		return Collections.<String, Object> emptyMap();
+		return Collections.emptyMap();
 	}
 }
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeSpecificationImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeSpecificationImpl.java
index 5877f10..39c4766 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeSpecificationImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeSpecificationImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007, 2014 IBM Corporation and others.
+ * Copyright (c) 2007, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -14,11 +14,19 @@
  *******************************************************************************/
 package org.eclipse.osgi.internal.resolver;
 
-import java.util.*;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Dictionary;
+import java.util.Map;
 import org.eclipse.osgi.internal.framework.AliasMapper;
-import org.eclipse.osgi.service.resolver.*;
+import org.eclipse.osgi.service.resolver.BaseDescription;
+import org.eclipse.osgi.service.resolver.NativeCodeDescription;
+import org.eclipse.osgi.service.resolver.NativeCodeSpecification;
+import org.eclipse.osgi.service.resolver.State;
 import org.eclipse.osgi.service.resolver.VersionRange;
-import org.osgi.framework.*;
+import org.osgi.framework.Constants;
+import org.osgi.framework.Filter;
+import org.osgi.framework.Version;
 
 public class NativeCodeSpecificationImpl extends VersionConstraintImpl implements NativeCodeSpecification {
 	private static final NativeCodeDescription[] EMPTY_NATIVECODEDESCRIPTIONS = new NativeCodeDescription[0];
@@ -187,12 +195,12 @@
 
 	@Override
 	protected Map<String, String> getInternalDirectives() {
-		return Collections.<String, String> emptyMap();
+		return Collections.emptyMap();
 	}
 
 	@Override
 	protected Map<String, Object> getInteralAttributes() {
-		return Collections.<String, Object> emptyMap();
+		return Collections.emptyMap();
 	}
 
 	@Override
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateHelperImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateHelperImpl.java
index 78da2ae..8c00533 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateHelperImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateHelperImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2016 IBM Corporation and others.
+ * Copyright (c) 2004, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -489,7 +489,7 @@
 							substituteNames.clear();
 						// substituteNames is a set of one package containing the single substitute we are trying to get the source for
 						substituteNames.add(exportName);
-						getPackages(resolvedImport.getSupplier(), symbolicName, importList, orderedPkgList, pkgSet, new HashSet<BundleDescription>(0), strict, substituteNames, options);
+						getPackages(resolvedImport.getSupplier(), symbolicName, importList, orderedPkgList, pkgSet, new HashSet<>(0), strict, substituteNames, options);
 					}
 				}
 			}
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateObjectFactoryImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateObjectFactoryImpl.java
index e7b26ea..e569fd9 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateObjectFactoryImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateObjectFactoryImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2016 IBM Corporation and others.
+ * Copyright (c) 2003, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -534,7 +534,7 @@
 		try {
 			ManifestElement[] elements = ManifestElement.parseHeader(Constants.REQUIRE_BUNDLE, declaration);
 			if (elements == null)
-				return Collections.<BundleSpecification> emptyList();
+				return Collections.emptyList();
 			List<BundleSpecification> result = new ArrayList<>(elements.length);
 			for (ManifestElement element : elements)
 				result.add(StateBuilder.createRequiredBundle(element));
@@ -548,7 +548,7 @@
 		try {
 			ManifestElement[] elements = ManifestElement.parseHeader(Constants.FRAGMENT_HOST, declaration);
 			if (elements == null)
-				return Collections.<HostSpecification> emptyList();
+				return Collections.emptyList();
 			List<HostSpecification> result = new ArrayList<>(elements.length);
 			for (ManifestElement element : elements)
 				result.add(StateBuilder.createHostSpecification(element, null));
@@ -562,7 +562,7 @@
 		try {
 			ManifestElement[] elements = ManifestElement.parseHeader(Constants.IMPORT_PACKAGE, declaration);
 			if (elements == null)
-				return Collections.<ImportPackageSpecification> emptyList();
+				return Collections.emptyList();
 			List<ImportPackageSpecification> result = new ArrayList<>(elements.length);
 			for (ManifestElement element : elements)
 				StateBuilder.addImportPackages(element, result, 2, false);
@@ -576,8 +576,8 @@
 		try {
 			ManifestElement[] elements = ManifestElement.parseHeader(Constants.PROVIDE_CAPABILITY, declaration);
 			if (elements == null)
-				return Collections.<GenericDescription> emptyList();
-			return StateBuilder.createOSGiCapabilities(elements, new ArrayList<GenericDescription>(elements.length), (Integer) null);
+				return Collections.emptyList();
+			return StateBuilder.createOSGiCapabilities(elements, new ArrayList<>(elements.length), (Integer) null);
 		} catch (BundleException e) {
 			throw new IllegalArgumentException("Declaration is invalid: " + declaration, e); //$NON-NLS-1$
 		}
@@ -587,8 +587,8 @@
 		try {
 			ManifestElement[] elements = ManifestElement.parseHeader(Constants.REQUIRE_CAPABILITY, declaration);
 			if (elements == null)
-				return Collections.<GenericSpecification> emptyList();
-			return StateBuilder.createOSGiRequires(elements, new ArrayList<GenericSpecification>(elements.length));
+				return Collections.emptyList();
+			return StateBuilder.createOSGiRequires(elements, new ArrayList<>(elements.length));
 		} catch (BundleException e) {
 			throw new IllegalArgumentException("Declaration is invalid: " + declaration, e); //$NON-NLS-1$
 		}
@@ -598,7 +598,7 @@
 		try {
 			ManifestElement[] elements = ManifestElement.parseHeader(Constants.IMPORT_PACKAGE, declaration);
 			if (elements == null)
-				return Collections.<ExportPackageDescription> emptyList();
+				return Collections.emptyList();
 			List<ExportPackageDescription> result = new ArrayList<>(elements.length);
 			for (ManifestElement element : elements)
 				StateBuilder.addExportPackages(element, result, false);
diff --git a/bundles/org.eclipse.osgi.tests/bundles_src/storage.hooks.a/org/eclipse/osgi/tests/hooks/framework/storage/a/TestHookConfigurator.java b/bundles/org.eclipse.osgi.tests/bundles_src/storage.hooks.a/org/eclipse/osgi/tests/hooks/framework/storage/a/TestHookConfigurator.java
index 1b95e51..684b93e 100644
--- a/bundles/org.eclipse.osgi.tests/bundles_src/storage.hooks.a/org/eclipse/osgi/tests/hooks/framework/storage/a/TestHookConfigurator.java
+++ b/bundles/org.eclipse.osgi.tests/bundles_src/storage.hooks.a/org/eclipse/osgi/tests/hooks/framework/storage/a/TestHookConfigurator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2013, 2017 IBM Corporation and others.
+ * Copyright (c) 2013, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -91,9 +91,9 @@
 					replace.setId(5678);
 					replace.setSymbolicName("replace");
 					replace.setVersion(Version.parseVersion("1.1.1"));
-					replace.addCapability("replace", Collections.<String, String> emptyMap(), Collections.<String, Object> emptyMap());
-					replace.addCapability(IdentityNamespace.IDENTITY_NAMESPACE, Collections.<String, String> emptyMap(), Collections.<String, Object> singletonMap(IdentityNamespace.IDENTITY_NAMESPACE, "replace"));
-					replace.addCapability(BundleNamespace.BUNDLE_NAMESPACE, Collections.<String, String> emptyMap(), Collections.<String, Object> singletonMap(BundleNamespace.BUNDLE_NAMESPACE, "replace"));
+					replace.addCapability("replace", Collections.emptyMap(), Collections.emptyMap());
+					replace.addCapability(IdentityNamespace.IDENTITY_NAMESPACE, Collections.emptyMap(), Collections.singletonMap(IdentityNamespace.IDENTITY_NAMESPACE, "replace"));
+					replace.addCapability(BundleNamespace.BUNDLE_NAMESPACE, Collections.emptyMap(), Collections.singletonMap(BundleNamespace.BUNDLE_NAMESPACE, "replace"));
 					return replace;
 				}
 				if (TestHookConfigurator.adaptManifest) {
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/MultiReleaseJarTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/MultiReleaseJarTests.java
index 39712ff..3a80a48 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/MultiReleaseJarTests.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/MultiReleaseJarTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2017, 2020 IBM Corporation and others.
+ * Copyright (c) 2017, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -222,7 +222,7 @@
 		classPathJarEntries.put("META-INF/versions/11/multi/release/test/sub/testResource11.txt", getBytes("multi/release/test/sub/testResource11.txt", base, new byte[] {'1', '1'}));
 		classPathJarEntries.put("META-INF/versions/11/multi/release/test/sub/testResourceAdd11.txt", getBytes("multi/release/test/sub/testResourceAdd11.txt", base));
 
-		createMRJar(classpathMrJar, Collections.<String, String> emptyMap(), classPathJarEntries);
+		createMRJar(classpathMrJar, Collections.emptyMap(), classPathJarEntries);
 		bundleEntries.put(classpathMrJar.getName(), StorageUtil.getBytes(new FileInputStream(classpathMrJar), -1, 4000));
 
 		// This will not be required by the spec, but equinox does support exploded inner jars in a bundle
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/TestModuleContainer.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/TestModuleContainer.java
index eaaac92..3992019 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/TestModuleContainer.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/TestModuleContainer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2013, 2017 IBM Corporation and others.
+ * Copyright (c) 2013, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -170,7 +170,7 @@
 				Assert.assertNull("Unexpected install errors.", installErrors);
 			}
 		}
-		container.resolve(new ArrayList<Module>(), false);
+		container.resolve(new ArrayList<>(), false);
 		List<Module> modules = container.getModules();
 		for (Module module : modules) {
 			if (module.getCurrentRevision().getWiring() == null) {
@@ -203,7 +203,7 @@
 		resolvedModuleDatabase.store(new DataOutputStream(bytes), false);
 		bytes.close();
 		adaptor.getDatabase().load(new DataInputStream(new ByteArrayInputStream(bytes.toByteArray())));
-		adaptor.getContainer().resolve(new ArrayList<Module>(), false);
+		adaptor.getContainer().resolve(new ArrayList<>(), false);
 	}
 
 	// Disabled @Test
@@ -227,7 +227,7 @@
 		resolvedModuleDatabase.store(new DataOutputStream(bytes), true);
 		bytes.close();
 		adaptor.getDatabase().load(new DataInputStream(new ByteArrayInputStream(bytes.toByteArray())));
-		adaptor.getContainer().resolve(new ArrayList<Module>(), false);
+		adaptor.getContainer().resolve(new ArrayList<>(), false);
 	}
 
 	// Disabled @Test
@@ -457,7 +457,7 @@
 
 	@Test
 	public void testInstallCollision02() throws BundleException, IOException {
-		DummyContainerAdaptor adaptor = new DummyContainerAdaptor(new DummyCollisionHook(true), Collections.<String, String> emptyMap());
+		DummyContainerAdaptor adaptor = new DummyContainerAdaptor(new DummyCollisionHook(true), Collections.emptyMap());
 		ModuleContainer container = adaptor.getContainer();
 		installDummyModule("system.bundle.MF", Constants.SYSTEM_BUNDLE_LOCATION, container);
 		installDummyModule("b1_v1.MF", "b1_a", container);
@@ -494,7 +494,7 @@
 	@Test
 	public void testUpdateCollision03() throws BundleException, IOException {
 
-		DummyContainerAdaptor adaptor = new DummyContainerAdaptor(new DummyCollisionHook(true), Collections.<String, String> emptyMap());
+		DummyContainerAdaptor adaptor = new DummyContainerAdaptor(new DummyCollisionHook(true), Collections.emptyMap());
 		ModuleContainer container = adaptor.getContainer();
 		Module b1_v1 = installDummyModule("b1_v1.MF", "b1_v1", container);
 		installDummyModule("b1_v2.MF", "b1_v2", container);
@@ -550,7 +550,7 @@
 				};
 			}
 		};
-		DummyContainerAdaptor adaptor = new DummyContainerAdaptor(new DummyCollisionHook(false), Collections.<String, String> emptyMap(), resolverHookFactory);
+		DummyContainerAdaptor adaptor = new DummyContainerAdaptor(new DummyCollisionHook(false), Collections.emptyMap(), resolverHookFactory);
 		ModuleContainer container = adaptor.getContainer();
 
 		Module s1 = installDummyModule("singleton1_v1.MF", "s1_v1", container);
@@ -615,7 +615,7 @@
 				};
 			}
 		};
-		DummyContainerAdaptor adaptor = new DummyContainerAdaptor(new DummyCollisionHook(false), Collections.<String, String> emptyMap(), resolverHookFactory);
+		DummyContainerAdaptor adaptor = new DummyContainerAdaptor(new DummyCollisionHook(false), Collections.emptyMap(), resolverHookFactory);
 		ModuleContainer container = adaptor.getContainer();
 
 		Module s1_v1 = installDummyModule("singleton1_v1.MF", "s1_v1", container);
@@ -2609,8 +2609,8 @@
 		ModuleRevisionBuilder builder = new ModuleRevisionBuilder();
 		builder.setSymbolicName("invalid.attr");
 		builder.setVersion(Version.valueOf("1.0.0"));
-		builder.addCapability("test", Collections.<String, String> emptyMap(), Collections.singletonMap("test", (Object) testInt));
-		builder.addCapability("test.list", Collections.<String, String> emptyMap(), Collections.singletonMap("test.list", (Object) testIntList));
+		builder.addCapability("test", Collections.emptyMap(), Collections.singletonMap("test", (Object) testInt));
+		builder.addCapability("test.list", Collections.emptyMap(), Collections.singletonMap("test.list", (Object) testIntList));
 		Module invalid = container.install(null, builder.getSymbolicName(), builder, null);
 
 		Object testAttr = invalid.getCurrentRevision().getCapabilities("test").get(0).getAttributes().get("test");
@@ -2902,7 +2902,7 @@
 		manifest.put(Constants.EXPORT_PACKAGE, "export");
 		installDummyModule(manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME), container);
 
-		report = container.resolve(Collections.<Module> emptySet(), false);
+		report = container.resolve(Collections.emptySet(), false);
 		Assert.assertNull("Found a error.", report.getResolutionException());
 
 		State expectedState = enabled ? State.ACTIVE : State.RESOLVED;
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/dummys/UnresolvedProviderEntryBuilder.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/dummys/UnresolvedProviderEntryBuilder.java
index 8529fb4..d0d2370 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/dummys/UnresolvedProviderEntryBuilder.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/dummys/UnresolvedProviderEntryBuilder.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012 IBM Corporation and others.
+ * Copyright (c) 2012, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -35,7 +35,7 @@
 	}
 
 	public UnresolvedProviderEntryBuilder requirement(Requirement key) {
-		data.put(key, new ArrayList<Capability>());
+		data.put(key, new ArrayList<>());
 		lastRequirement = key;
 		return this;
 	}
diff --git a/bundles/org.eclipse.osgi.util/src/org/osgi/util/promise/PromiseFactory.java b/bundles/org.eclipse.osgi.util/src/org/osgi/util/promise/PromiseFactory.java
index 23eb0cc..8c4cd82 100644
--- a/bundles/org.eclipse.osgi.util/src/org/osgi/util/promise/PromiseFactory.java
+++ b/bundles/org.eclipse.osgi.util/src/org/osgi/util/promise/PromiseFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2017, 2018). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2017, 2021). All Rights Reserved.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -347,8 +347,7 @@
 			callbacks = new DefaultExecutors();
 			scheduledExecutor = new ScheduledExecutor(2, callbacks);
 			callbackExecutor = new ThreadPoolExecutor(0, 64, 60L,
-					TimeUnit.SECONDS, new SynchronousQueue<Runnable>(),
-					callbacks, callbacks);
+					TimeUnit.SECONDS, new SynchronousQueue<>(), callbacks, callbacks);
 		}
 
 		static Executor callbackExecutor() {
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleContainer.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleContainer.java
index c8f1919..ab7bf6f 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleContainer.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleContainer.java
@@ -494,7 +494,7 @@
 
 	private ResolutionReport resolve(Collection<Module> triggers, boolean triggersMandatory, boolean restartTriggers) {
 		if (isRefreshingSystemModule()) {
-			return new ModuleResolutionReport(null, Collections.<Resource, List<Entry>> emptyMap(), new ResolutionException("Unable to resolve while shutting down the framework.")); //$NON-NLS-1$
+			return new ModuleResolutionReport(null, Collections.emptyMap(), new ResolutionException("Unable to resolve while shutting down the framework.")); //$NON-NLS-1$
 		}
 		ResolutionReport report = null;
 		try (ResolutionLock.Permits resolutionPermits = _resolutionLock.acquire(1)) {
@@ -505,14 +505,14 @@
 					if (e.getCause() instanceof BundleException) {
 						BundleException be = (BundleException) e.getCause();
 						if (be.getType() == BundleException.REJECTED_BY_HOOK || be.getType() == BundleException.STATECHANGE_ERROR) {
-							return new ModuleResolutionReport(null, Collections.<Resource, List<Entry>> emptyMap(), new ResolutionException(be));
+							return new ModuleResolutionReport(null, Collections.emptyMap(), new ResolutionException(be));
 						}
 					}
 					throw e;
 				}
 			} while (report == null);
 		} catch (ResolutionLockException e) {
-			return new ModuleResolutionReport(null, Collections.<Resource, List<Entry>> emptyMap(), new ResolutionException("Timeout acquiring lock for resolution", e, Collections.<Requirement> emptyList())); //$NON-NLS-1$
+			return new ModuleResolutionReport(null, Collections.emptyMap(), new ResolutionException("Timeout acquiring lock for resolution", e, Collections.emptyList())); //$NON-NLS-1$
 		}
 		return report;
 	}
@@ -547,7 +547,7 @@
 
 		ModuleResolutionReport report = moduleResolver.resolveDelta(triggerRevisions, triggersMandatory, unresolved, wiringClone, moduleDatabase);
 		Map<Resource, List<Wire>> resolutionResult = report.getResolutionResult();
-		Map<ModuleRevision, ModuleWiring> deltaWiring = resolutionResult == null ? Collections.<ModuleRevision, ModuleWiring> emptyMap() : moduleResolver.generateDelta(resolutionResult, wiringClone);
+		Map<ModuleRevision, ModuleWiring> deltaWiring = resolutionResult == null ? Collections.emptyMap() : moduleResolver.generateDelta(resolutionResult, wiringClone);
 		if (deltaWiring.isEmpty())
 			return report; // nothing to do
 
@@ -617,7 +617,7 @@
 				for (DynamicModuleRequirement dynamicReq : dynamicReqs) {
 					ModuleResolutionReport report = moduleResolver.resolveDynamicDelta(dynamicReq, unresolved, wiringClone, moduleDatabase);
 					Map<Resource, List<Wire>> resolutionResult = report.getResolutionResult();
-					deltaWiring = resolutionResult == null ? Collections.<ModuleRevision, ModuleWiring> emptyMap() : moduleResolver.generateDelta(resolutionResult, wiringClone);
+					deltaWiring = resolutionResult == null ? Collections.emptyMap() : moduleResolver.generateDelta(resolutionResult, wiringClone);
 					if (deltaWiring.get(revision) != null) {
 						break;
 					}
@@ -656,7 +656,7 @@
 				// Save the result
 				ModuleWiring wiring = deltaWiring.get(revision);
 				result = findExistingDynamicWire(wiring, dynamicPkgName);
-			} while (!applyDelta(deltaWiring, modulesResolved, Collections.<Module> emptyList(), timestamp, false, resolutionPermits));
+			} while (!applyDelta(deltaWiring, modulesResolved, Collections.emptyList(), timestamp, false, resolutionPermits));
 		} catch (ResolutionLockException e) {
 			return null;
 		}
@@ -858,7 +858,7 @@
 		}
 
 		// If there are any triggers re-start them now if requested
-		Set<Module> triggerSet = restartTriggers ? new HashSet<>(triggers) : Collections.<Module> emptySet();
+		Set<Module> triggerSet = restartTriggers ? new HashSet<>(triggers) : Collections.emptySet();
 		if (restartTriggers) {
 			for (Module module : triggers) {
 				if (module.getId() != 0 && Module.RESOLVED_SET.contains(module.getState())) {
@@ -1415,8 +1415,8 @@
 	static Requirement getIdentityRequirement(String name, Version version) {
 		version = version == null ? Version.emptyVersion : version;
 		String filter = "(&(" + IdentityNamespace.IDENTITY_NAMESPACE + "=" + name + ")(" + IdentityNamespace.CAPABILITY_VERSION_ATTRIBUTE + "=" + version.toString() + "))"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$//$NON-NLS-5$
-		Map<String, String> directives = Collections.<String, String> singletonMap(Namespace.REQUIREMENT_FILTER_DIRECTIVE, filter);
-		return new ModuleRequirement(IdentityNamespace.IDENTITY_NAMESPACE, directives, Collections.<String, Object> emptyMap(), null);
+		Map<String, String> directives = Collections.singletonMap(Namespace.REQUIREMENT_FILTER_DIRECTIVE, filter);
+		return new ModuleRequirement(IdentityNamespace.IDENTITY_NAMESPACE, directives, Collections.emptyMap(), null);
 	}
 
 	class ContainerWiring implements FrameworkWiring, EventDispatcher<ContainerWiring, FrameworkListener[], Collection<Module>> {
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolutionReport.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolutionReport.java
index 2e02139..edd51c8 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolutionReport.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolutionReport.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2013, 2016 IBM Corporation and others.
+ * Copyright (c) 2013, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -13,15 +13,27 @@
  *******************************************************************************/
 package org.eclipse.osgi.container;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 import org.eclipse.osgi.internal.framework.FilterImpl;
 import org.eclipse.osgi.internal.messages.Msg;
 import org.eclipse.osgi.report.resolution.ResolutionReport;
 import org.osgi.framework.Constants;
 import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.namespace.*;
+import org.osgi.framework.namespace.BundleNamespace;
+import org.osgi.framework.namespace.HostNamespace;
+import org.osgi.framework.namespace.PackageNamespace;
 import org.osgi.framework.wiring.BundleRevision;
-import org.osgi.resource.*;
+import org.osgi.resource.Capability;
+import org.osgi.resource.Namespace;
+import org.osgi.resource.Requirement;
+import org.osgi.resource.Resource;
+import org.osgi.resource.Wire;
 import org.osgi.service.resolver.ResolutionException;
 
 /**
@@ -72,8 +84,8 @@
 	private final Map<Resource, List<Wire>> resolutionResult;
 
 	ModuleResolutionReport(Map<Resource, List<Wire>> resolutionResult, Map<Resource, List<Entry>> entries, ResolutionException cause) {
-		this.entries = entries == null ? Collections.<Resource, List<Entry>> emptyMap() : Collections.unmodifiableMap(new HashMap<>(entries));
-		this.resolutionResult = resolutionResult == null ? Collections.<Resource, List<Wire>> emptyMap() : Collections.unmodifiableMap(resolutionResult);
+		this.entries = entries == null ? Collections.emptyMap() : Collections.unmodifiableMap(new HashMap<>(entries));
+		this.resolutionResult = resolutionResult == null ? Collections.emptyMap() : Collections.unmodifiableMap(resolutionResult);
 		this.resolutionException = cause;
 	}
 
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolver.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolver.java
index bf82607..d50937c 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolver.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolver.java
@@ -465,7 +465,7 @@
 			}
 
 			Map<Resource, ResolutionException> getUsesConstraintViolations() {
-				return errors == null ? Collections.<Resource, ResolutionException> emptyMap() : errors;
+				return errors == null ? Collections.emptyMap() : errors;
 			}
 
 			@Override
@@ -811,7 +811,7 @@
 			Collection<Resource> relatedFragments = new ArrayList<>();
 			for (String hostBSN : getHostBSNs(hostCaps)) {
 				String matchFilter = "(" + EquinoxFragmentNamespace.FRAGMENT_NAMESPACE + "=" + hostBSN + ")"; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
-				Requirement fragmentRequirement = ModuleContainer.createRequirement(EquinoxFragmentNamespace.FRAGMENT_NAMESPACE, Collections.<String, String> singletonMap(Namespace.REQUIREMENT_FILTER_DIRECTIVE, matchFilter), Collections.<String, Object> emptyMap());
+				Requirement fragmentRequirement = ModuleContainer.createRequirement(EquinoxFragmentNamespace.FRAGMENT_NAMESPACE, Collections.singletonMap(Namespace.REQUIREMENT_FILTER_DIRECTIVE, matchFilter), Collections.emptyMap());
 				List<ModuleCapability> candidates = moduleDatabase.findCapabilities(fragmentRequirement);
 				// filter out disabled fragments and singletons
 				filterDisabled(candidates);
@@ -870,7 +870,7 @@
 					if (e.getCause() instanceof BundleException) {
 						BundleException be = (BundleException) e.getCause();
 						if (be.getType() == BundleException.REJECTED_BY_HOOK) {
-							return new ModuleResolutionReport(null, Collections.<Resource, List<Entry>> emptyMap(), new ResolutionException(be));
+							return new ModuleResolutionReport(null, Collections.emptyMap(), new ResolutionException(be));
 						}
 					}
 					throw e;
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRevisionBuilder.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRevisionBuilder.java
index 7549469..a0cf9ed 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRevisionBuilder.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRevisionBuilder.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012, 2020 IBM Corporation and others.
+ * Copyright (c) 2012, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -352,7 +352,7 @@
 		if (size == 1) {
 			if (map.getClass() != SINGLETON_MAP_CLASS) {
 				Map.Entry<? extends K, ? extends V> entry = map.entrySet().iterator().next();
-				map = Collections.<K, V> singletonMap(entry.getKey(), entry.getValue());
+				map = Collections.singletonMap(entry.getKey(), entry.getValue());
 			}
 		} else {
 			if (map.getClass() != UNMODIFIABLE_MAP_CLASS) {
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleWiring.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleWiring.java
index 3772f11..bdd3398 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleWiring.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleWiring.java
@@ -79,8 +79,7 @@
 		this.requirements = requirements;
 		this.providedWires = providedWires;
 		this.requiredWires = requiredWires;
-		this.substitutedPkgNames = substitutedPkgNames.isEmpty() ? Collections.<String>emptyList()
-				: substitutedPkgNames;
+		this.substitutedPkgNames = substitutedPkgNames.isEmpty() ? Collections.emptyList() : substitutedPkgNames;
 	}
 
 	@Override
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/builders/OSGiManifestBuilderFactory.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/builders/OSGiManifestBuilderFactory.java
index 91c379b..b3c8ece 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/builders/OSGiManifestBuilderFactory.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/builders/OSGiManifestBuilderFactory.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012, 2020 IBM Corporation and others.
+ * Copyright (c) 2012, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -405,7 +405,7 @@
 				if ("true".equals(optionalAttr) && packageDirectives.get(Namespace.REQUIREMENT_RESOLUTION_DIRECTIVE) == null) { //$NON-NLS-1$
 					packageDirectives.put(Namespace.REQUIREMENT_RESOLUTION_DIRECTIVE, Namespace.RESOLUTION_OPTIONAL);
 				}
-				builder.addRequirement(PackageNamespace.PACKAGE_NAMESPACE, packageDirectives, new HashMap<String, Object>(0));
+				builder.addRequirement(PackageNamespace.PACKAGE_NAMESPACE, packageDirectives, new HashMap<>(0));
 			}
 		}
 	}
@@ -422,7 +422,7 @@
 			filter.append('(').append(PackageNamespace.CAPABILITY_VERSION_ATTRIBUTE).append(">=").append(packageVersion).append("))"); //$NON-NLS-1$//$NON-NLS-2$
 			Map<String, String> directives = new HashMap<>(1);
 			directives.put(PackageNamespace.REQUIREMENT_FILTER_DIRECTIVE, filter.toString());
-			builder.addRequirement(PackageNamespace.PACKAGE_NAMESPACE, directives, new HashMap<String, Object>(0));
+			builder.addRequirement(PackageNamespace.PACKAGE_NAMESPACE, directives, new HashMap<>(0));
 		}
 	}
 
@@ -478,7 +478,7 @@
 				if ("true".equals(reprovideAttr) && bundleDirectives.get(BundleNamespace.REQUIREMENT_VISIBILITY_DIRECTIVE) == null) { //$NON-NLS-1$
 					bundleDirectives.put(BundleNamespace.REQUIREMENT_VISIBILITY_DIRECTIVE, BundleNamespace.VISIBILITY_REEXPORT);
 				}
-				builder.addRequirement(BundleNamespace.BUNDLE_NAMESPACE, bundleDirectives, new HashMap<String, Object>(0));
+				builder.addRequirement(BundleNamespace.BUNDLE_NAMESPACE, bundleDirectives, new HashMap<>(0));
 			}
 		}
 	}
@@ -509,10 +509,10 @@
 			// need to add (&...)
 			filter.insert(0, "(&").append(')'); //$NON-NLS-1$
 		directives.put(BundleNamespace.REQUIREMENT_FILTER_DIRECTIVE, filter.toString());
-		builder.addRequirement(HostNamespace.HOST_NAMESPACE, directives, new HashMap<String, Object>(0));
+		builder.addRequirement(HostNamespace.HOST_NAMESPACE, directives, new HashMap<>(0));
 		// Add a fragment capability to advertise what host this resource is providing a fragment for
 		directives = Collections.singletonMap(EquinoxModuleDataNamespace.CAPABILITY_EFFECTIVE_DIRECTIVE, EquinoxModuleDataNamespace.EFFECTIVE_INFORMATION);
-		builder.addCapability(EquinoxFragmentNamespace.FRAGMENT_NAMESPACE, directives, Collections.<String, Object> singletonMap(EquinoxFragmentNamespace.FRAGMENT_NAMESPACE, hostName));
+		builder.addCapability(EquinoxFragmentNamespace.FRAGMENT_NAMESPACE, directives, Collections.singletonMap(EquinoxFragmentNamespace.FRAGMENT_NAMESPACE, hostName));
 	}
 
 	private static void getProvideCapabilities(ModuleRevisionBuilder builder, ManifestElement[] provideElements, boolean checkSystemCapabilities) throws BundleException {
@@ -553,7 +553,7 @@
 		// only support one
 		HashMap<String, String> directives = new HashMap<>();
 		directives.put(EclipsePlatformNamespace.REQUIREMENT_FILTER_DIRECTIVE, platformFilter);
-		builder.addRequirement(EclipsePlatformNamespace.ECLIPSE_PLATFORM_NAMESPACE, directives, Collections.<String, Object> emptyMap());
+		builder.addRequirement(EclipsePlatformNamespace.ECLIPSE_PLATFORM_NAMESPACE, directives, Collections.emptyMap());
 	}
 
 	@SuppressWarnings("deprecation")
@@ -733,7 +733,7 @@
 
 		Map<String, String> directives = new HashMap<>(1);
 		directives.put(ExecutionEnvironmentNamespace.REQUIREMENT_FILTER_DIRECTIVE, filterSpec);
-		builder.addRequirement(ExecutionEnvironmentNamespace.EXECUTION_ENVIRONMENT_NAMESPACE, directives, new HashMap<String, Object>(0));
+		builder.addRequirement(ExecutionEnvironmentNamespace.EXECUTION_ENVIRONMENT_NAMESPACE, directives, new HashMap<>(0));
 	}
 
 	static String escapeFilterInput(final String value) {
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/ObjectPool.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/ObjectPool.java
index 44853f0..e684835 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/ObjectPool.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/ObjectPool.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009, 2016 IBM Corporation and others.
+ * Copyright (c) 2009, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -38,7 +38,7 @@
 						Debug.println("[ObjectPool] Found duplicate object: " + getObjectString(obj)); //$NON-NLS-1$
 				}
 			} else {
-				objectCache.put(obj, new WeakReference<Object>(obj));
+				objectCache.put(obj, new WeakReference<>(obj));
 				if (DEBUG_OBJECTPOOL_ADDS)
 					Debug.println("[ObjectPool] Added unique object to pool: " + getObjectString(obj) + " Pool size: " + objectCache.size()); //$NON-NLS-1$ //$NON-NLS-2$
 			}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/connect/DelegatingConnectClassLoader.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/connect/DelegatingConnectClassLoader.java
index d9e1cf5..9b16f16 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/connect/DelegatingConnectClassLoader.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/connect/DelegatingConnectClassLoader.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2019 IBM Corporation and others.
+ * Copyright (c) 2019, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -56,12 +56,12 @@
 	@Override
 	public Enumeration<URL> findLocalResources(String resource) {
 		if (connectClassLoader == null) {
-			return Collections.enumeration(Collections.<URL> emptyList());
+			return Collections.enumeration(Collections.emptyList());
 		}
 		try {
 			return connectClassLoader.getResources(resource);
 		} catch (IOException e) {
-			return Collections.enumeration(Collections.<URL> emptyList());
+			return Collections.enumeration(Collections.emptyList());
 		}
 	}
 }
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/container/AtomicLazyInitializer.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/container/AtomicLazyInitializer.java
index 071ab61..e55380c 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/container/AtomicLazyInitializer.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/container/AtomicLazyInitializer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2014, 2016 IBM Corporation and others.
+ * Copyright (c) 2014, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -69,7 +69,7 @@
 	}
 
 	private static <T> T unchecked(Exception exception) {
-		return AtomicLazyInitializer.<T, RuntimeException> unchecked0(exception);
+		return AtomicLazyInitializer.unchecked0(exception);
 	}
 
 	@SuppressWarnings("unchecked")
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/container/Capabilities.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/container/Capabilities.java
index 68318a6..76942e8 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/container/Capabilities.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/container/Capabilities.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012, 2016 IBM Corporation and others.
+ * Copyright (c) 2012, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,15 @@
  *******************************************************************************/
 package org.eclipse.osgi.internal.container;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import org.eclipse.osgi.container.ModuleCapability;
@@ -22,8 +30,13 @@
 import org.eclipse.osgi.util.ManifestElement;
 import org.osgi.framework.Filter;
 import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.namespace.*;
-import org.osgi.resource.*;
+import org.osgi.framework.namespace.AbstractWiringNamespace;
+import org.osgi.framework.namespace.BundleNamespace;
+import org.osgi.framework.namespace.HostNamespace;
+import org.osgi.framework.namespace.PackageNamespace;
+import org.osgi.resource.Capability;
+import org.osgi.resource.Namespace;
+import org.osgi.resource.Requirement;
 
 public class Capabilities {
 	static class NamespaceSet {
@@ -234,7 +247,7 @@
 				}
 			}
 		}
-		return packageNames == null ? Collections.<String> emptyList() : packageNames;
+		return packageNames == null ? Collections.emptyList() : packageNames;
 	}
 
 	/**
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/BundleContextImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/BundleContextImpl.java
index 320d689..00f05f7 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/BundleContextImpl.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/BundleContextImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2020 IBM Corporation and others.
+ * Copyright (c) 2003, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -1063,8 +1063,7 @@
 		@SuppressWarnings("unchecked")
 		ServiceReference<S>[] refs = (ServiceReference<S>[]) getServiceReferences(clazz.getName(), filter);
 		if (refs == null) {
-			Collection<ServiceReference<S>> empty = Collections.<ServiceReference<S>> emptyList();
-			return empty;
+			return Collections.emptyList();
 		}
 		List<ServiceReference<S>> result = new ArrayList<>(refs.length);
 		Collections.addAll(result, refs);
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/ContextFinder.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/ContextFinder.java
index fe0c79a..584427a 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/ContextFinder.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/ContextFinder.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2016 IBM Corporation and others.
+ * Copyright (c) 2005, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -173,7 +173,7 @@
 	public Enumeration<URL> getResources(String arg0) throws IOException {
 		//Shortcut cycle
 		if (startLoading(arg0) == false) {
-			return Collections.enumeration(Collections.<URL> emptyList());
+			return Collections.enumeration(Collections.emptyList());
 		}
 		try {
 			List<ClassLoader> toConsult = findClassLoaders();
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxContainerAdaptor.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxContainerAdaptor.java
index 43098b9..626ff65 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxContainerAdaptor.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxContainerAdaptor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012, 2017 IBM Corporation and others.
+ * Copyright (c) 2012, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -110,7 +110,7 @@
 		this.resolverExecutor = new AtomicLazyInitializer<>();
 		this.lazyResolverExecutorCreator = createLazyExecutorCreator( //
 				"Equinox resolver thread - " + EquinoxContainerAdaptor.this.toString(), //$NON-NLS-1$
-				resolverThreadCnt, new SynchronousQueue<Runnable>());
+				resolverThreadCnt, new SynchronousQueue<>());
 
 		// For the start-level we can safely use a growing queue because the thread feeding the
 		// start-level executor with work is a single thread and it can safely block waiting
@@ -118,7 +118,7 @@
 		this.startLevelExecutor = new AtomicLazyInitializer<>();
 		this.lazyStartLevelExecutorCreator = createLazyExecutorCreator(//
 				"Equinox start level thread - " + EquinoxContainerAdaptor.this.toString(), //$NON-NLS-1$
-				startLevelThreadCnt, new LinkedBlockingQueue<Runnable>(1000));
+				startLevelThreadCnt, new LinkedBlockingQueue<>(1000));
 
 	}
 
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java
index 528eba6..563af45 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2020 IBM Corporation and others.
+ * Copyright (c) 2003, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -199,7 +199,7 @@
 	 */
 	@Override
 	public boolean match(ServiceReference<?> reference) {
-		return matches0((reference != null) ? ServiceReferenceMap.asMap(reference) : Collections.<String, Object> emptyMap());
+		return matches0((reference != null) ? ServiceReferenceMap.asMap(reference) : Collections.emptyMap());
 	}
 
 	/**
@@ -216,7 +216,7 @@
 	 */
 	@Override
 	public boolean match(Dictionary<String, ?> dictionary) {
-		return matches0((dictionary != null) ? new CaseInsensitiveDictionaryMap<>(dictionary) : Collections.<String, Object> emptyMap());
+		return matches0((dictionary != null) ? new CaseInsensitiveDictionaryMap<>(dictionary) : Collections.emptyMap());
 	}
 
 	/**
@@ -232,7 +232,7 @@
 	 */
 	@Override
 	public boolean matchCase(Dictionary<String, ?> dictionary) {
-		return matches0((dictionary != null) ? DictionaryMap.asMap(dictionary) : Collections.<String, Object> emptyMap());
+		return matches0((dictionary != null) ? DictionaryMap.asMap(dictionary) : Collections.emptyMap());
 	}
 
 	/**
@@ -249,7 +249,7 @@
 	 */
 	@Override
 	public boolean matches(Map<String, ?> map) {
-		return matches0((map != null) ? map : Collections.<String, Object> emptyMap());
+		return matches0((map != null) ? map : Collections.emptyMap());
 	}
 
 	abstract boolean matches0(Map<String, ?> map);
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/OSGiFrameworkHooks.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/OSGiFrameworkHooks.java
index 9fb875e..15adb5f 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/OSGiFrameworkHooks.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/OSGiFrameworkHooks.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012, 2020 IBM Corporation and others.
+ * Copyright (c) 2012, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -193,13 +193,13 @@
 			Module systemModule = mContainer == null ? null : mContainer.getModule(0);
 			ServiceRegistry registry = container.getServiceRegistry();
 			if (registry == null || systemModule == null) {
-				return new CoreResolverHook(Collections.<HookReference> emptyList(), systemModule);
+				return new CoreResolverHook(Collections.emptyList(), systemModule);
 			}
 
 			BundleContextImpl context = (BundleContextImpl) EquinoxContainer.secureAction.getContext(systemModule.getBundle());
 
 			ServiceReferenceImpl<ResolverHookFactory>[] refs = getHookReferences(registry, context);
-			List<HookReference> hookRefs = refs == null ? Collections.<CoreResolverHookFactory.HookReference>emptyList()
+			List<HookReference> hookRefs = refs == null ? Collections.emptyList()
 					: new ArrayList<>(refs.length);
 			if (refs != null) {
 				for (ServiceReferenceImpl<ResolverHookFactory> hookRef : refs) {
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/legacy/PackageAdminImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/legacy/PackageAdminImpl.java
index eb6f31c..b28b28d 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/legacy/PackageAdminImpl.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/legacy/PackageAdminImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2017 IBM Corporation and others.
+ * Copyright (c) 2003, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -107,7 +107,7 @@
 	@Override
 	public ExportedPackage[] getExportedPackages(String name) {
 		String filter = "(" + PackageNamespace.PACKAGE_NAMESPACE + "=" + (name == null ? "*" : name) + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
-		Map<String, String> directives = Collections.<String, String> singletonMap(Namespace.REQUIREMENT_FILTER_DIRECTIVE, filter);
+		Map<String, String> directives = Collections.singletonMap(Namespace.REQUIREMENT_FILTER_DIRECTIVE, filter);
 		Map<String, Boolean> attributes = Collections.singletonMap(Capabilities.SYNTHETIC_REQUIREMENT, Boolean.TRUE);
 		Requirement packageReq = ModuleContainer.createRequirement(PackageNamespace.PACKAGE_NAMESPACE, directives, attributes);
 		Collection<BundleCapability> packageCaps = frameworkWiring.findProviders(packageReq);
@@ -158,7 +158,7 @@
 	@Override
 	public RequiredBundle[] getRequiredBundles(String symbolicName) {
 		String filter = "(" + BundleNamespace.BUNDLE_NAMESPACE + "=" + (symbolicName == null ? "*" : symbolicName) + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
-		Map<String, String> directives = Collections.<String, String> singletonMap(Namespace.REQUIREMENT_FILTER_DIRECTIVE, filter);
+		Map<String, String> directives = Collections.singletonMap(Namespace.REQUIREMENT_FILTER_DIRECTIVE, filter);
 		Map<String, Boolean> attributes = Collections.singletonMap(Capabilities.SYNTHETIC_REQUIREMENT, Boolean.TRUE);
 		Requirement bundleReq = ModuleContainer.createRequirement(BundleNamespace.BUNDLE_NAMESPACE, directives, attributes);
 		Collection<BundleCapability> bundleCaps = frameworkWiring.findProviders(bundleReq);
@@ -184,7 +184,7 @@
 		}
 		VersionRange range = versionRange == null ? null : new VersionRange(versionRange);
 		String filter = (range != null ? "(&" : "") + "(" + IdentityNamespace.IDENTITY_NAMESPACE + "=" + symbolicName + ")" + (range != null ? range.toFilterString(IdentityNamespace.CAPABILITY_VERSION_ATTRIBUTE) + ")" : ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
-		Requirement identityReq = ModuleContainer.createRequirement(IdentityNamespace.IDENTITY_NAMESPACE, Collections.<String, String> singletonMap(Namespace.REQUIREMENT_FILTER_DIRECTIVE, filter), Collections.<String, Object> emptyMap());
+		Requirement identityReq = ModuleContainer.createRequirement(IdentityNamespace.IDENTITY_NAMESPACE, Collections.singletonMap(Namespace.REQUIREMENT_FILTER_DIRECTIVE, filter), Collections.emptyMap());
 		Collection<BundleCapability> identityCaps = frameworkWiring.findProviders(identityReq);
 
 		if (identityCaps.isEmpty()) {
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/BundleLoader.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/BundleLoader.java
index a1f451e..716f078 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/BundleLoader.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/BundleLoader.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2020 IBM Corporation and others.
+ * Copyright (c) 2004, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -183,7 +183,7 @@
 
 		// initialize the required bundle wires
 		List<ModuleWire> currentRequireBundleWires = wiring.getRequiredModuleWires(BundleNamespace.BUNDLE_NAMESPACE);
-		requiredBundleWires = currentRequireBundleWires == null || currentRequireBundleWires.isEmpty() ? Collections.<ModuleWire> emptyList() : Collections.unmodifiableList(currentRequireBundleWires);
+		requiredBundleWires = currentRequireBundleWires == null || currentRequireBundleWires.isEmpty() ? Collections.emptyList() : Collections.unmodifiableList(currentRequireBundleWires);
 
 		//Initialize the policy handler
 		List<ModuleCapability> moduleDatas = wiring.getRevision().getModuleCapabilities(EquinoxModuleDataNamespace.MODULE_DATA_NAMESPACE);
@@ -857,9 +857,9 @@
 
 	public static <E> Enumeration<E> compoundEnumerations(Enumeration<E> list1, Enumeration<E> list2) {
 		if (list2 == null || !list2.hasMoreElements())
-			return list1 == null ? BundleLoader.<E> emptyEnumeration() : list1;
+			return list1 == null ? BundleLoader.emptyEnumeration() : list1;
 		if (list1 == null || !list1.hasMoreElements())
-			return list2 == null ? BundleLoader.<E> emptyEnumeration() : list2;
+			return list2 == null ? BundleLoader.emptyEnumeration() : list2;
 		List<E> compoundResults = new ArrayList<>();
 		while (list1.hasMoreElements())
 			compoundResults.add(list1.nextElement());
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/GlobalPolicy.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/GlobalPolicy.java
index d016487..062cc8c 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/GlobalPolicy.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/GlobalPolicy.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2012 IBM Corporation and others.
+ * Copyright (c) 2005, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -83,8 +83,7 @@
 	private Collection<Bundle> getExportingBundles(String pkgName) {
 		Collection<Bundle> result = new ArrayList<>();
 		String filter = "(" + PackageNamespace.PACKAGE_NAMESPACE + "=" + pkgName + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		Map<String, String> directives = Collections
-				.<String, String>singletonMap(Namespace.REQUIREMENT_FILTER_DIRECTIVE, filter);
+		Map<String, String> directives = Collections.singletonMap(Namespace.REQUIREMENT_FILTER_DIRECTIVE, filter);
 		Map<String, Boolean> attributes = Collections.singletonMap(Capabilities.SYNTHETIC_REQUIREMENT, Boolean.TRUE);
 		Collection<BundleCapability> packages = frameworkWiring.findProviders(
 				ModuleContainer.createRequirement(PackageNamespace.PACKAGE_NAMESPACE, directives, attributes));
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/classpath/ClasspathManager.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/classpath/ClasspathManager.java
index ec13c90..c5c7f36 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/classpath/ClasspathManager.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/classpath/ClasspathManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2020 IBM Corporation and others.
+ * Copyright (c) 2005, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -874,7 +874,7 @@
 		for (FragmentClasspath fragmentClasspath : currentFragments)
 			generations.add(fragmentClasspath.getGeneration());
 
-		List<URL> result = Collections.<URL> emptyList();
+		List<URL> result = Collections.emptyList();
 		// now search over all the bundle files
 		Enumeration<URL> eURLs = Storage.findEntries(generations, path, filePattern, options);
 		if (eURLs == null)
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/sources/NullPackageSource.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/sources/NullPackageSource.java
index 3e8c151..3525cb4 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/sources/NullPackageSource.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/sources/NullPackageSource.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2014 IBM Corporation and others.
+ * Copyright (c) 2003, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -69,6 +69,6 @@
 
 	@Override
 	public List<String> listResources(String path, String filePattern) {
-		return Collections.<String> emptyList();
+		return Collections.emptyList();
 	}
 }
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ConfigAdminListener.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ConfigAdminListener.java
index a2d7319..d3a1501 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ConfigAdminListener.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ConfigAdminListener.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2017 IBM Corporation and others.
+ * Copyright (c) 2017, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -13,9 +13,20 @@
  *******************************************************************************/
 package org.eclipse.osgi.internal.log;
 
-import java.lang.reflect.*;
-import java.util.*;
-import org.osgi.framework.*;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.util.Collections;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
 import org.osgi.service.log.LogLevel;
 import org.osgi.util.tracker.ServiceTracker;
 import org.osgi.util.tracker.ServiceTrackerCustomizer;
@@ -191,7 +202,7 @@
 
 			String contextName = getContextName(pid);
 			if (type == CM_DELETED) {
-				setLogLevels(contextName, Collections.<String, LogLevel> emptyMap());
+				setLogLevels(contextName, Collections.emptyMap());
 				return null;
 			}
 
@@ -199,7 +210,7 @@
 				Dictionary<String, Object> configDictionary = findConfiguration(pid);
 				if (configDictionary == null) {
 					// Configuration got deleted before we could get it so treat as deleted
-					setLogLevels(contextName, Collections.<String, LogLevel> emptyMap());
+					setLogLevels(contextName, Collections.emptyMap());
 					return null;
 				}
 
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogServiceFactory.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogServiceFactory.java
index a6c3987..ff7249c 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogServiceFactory.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogServiceFactory.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2020 Cognos Incorporated, IBM Corporation and others
+ * Copyright (c) 2006, 2021 Cognos Incorporated, IBM Corporation and others
  *
  * This program and the accompanying materials are made
  * available under the terms of the Eclipse Public License 2.0 which
@@ -210,7 +210,7 @@
 
 		@Override
 		public void clear() {
-			setLogLevels(Collections.<String, LogLevel> emptyMap());
+			setLogLevels(Collections.emptyMap());
 		}
 
 		@Override
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogServiceImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogServiceImpl.java
index ad2fa69..3e1c36d 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogServiceImpl.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogServiceImpl.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2016 Cognos Incorporated, IBM Corporation and others
+ * Copyright (c) 2006, 2021 Cognos Incorporated, IBM Corporation and others
  *
  * This program and the accompanying materials are made
  * available under the terms of the Eclipse Public License 2.0 which
@@ -31,8 +31,8 @@
 	public ExtendedLogServiceImpl(ExtendedLogServiceFactory factory, Bundle bundle) {
 		this.factory = factory;
 		this.bundle = bundle;
-		loggerCache.put(org.osgi.service.log.Logger.class, new HashMap<String, LoggerImpl>());
-		loggerCache.put(org.osgi.service.log.FormatterLogger.class, new HashMap<String, LoggerImpl>());
+		loggerCache.put(org.osgi.service.log.Logger.class, new HashMap<>());
+		loggerCache.put(org.osgi.service.log.FormatterLogger.class, new HashMap<>());
 	}
 
 	@SuppressWarnings("deprecation")
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ServiceRegistry.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ServiceRegistry.java
index 7d05058..9f9f691 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ServiceRegistry.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ServiceRegistry.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2020 IBM Corporation and others.
+ * Copyright (c) 2004, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -795,11 +795,11 @@
 
 		if (oldFilteredListener != null) {
 			oldFilteredListener.markRemoved();
-			Collection<ListenerInfo> removedListeners = Collections.<ListenerInfo> singletonList(oldFilteredListener);
+			Collection<ListenerInfo> removedListeners = Collections.singletonList(oldFilteredListener);
 			notifyListenerHooks(removedListeners, false);
 		}
 
-		Collection<ListenerInfo> addedListeners = Collections.<ListenerInfo> singletonList(filteredListener);
+		Collection<ListenerInfo> addedListeners = Collections.singletonList(filteredListener);
 		notifyListenerHooks(addedListeners, true);
 	}
 
@@ -828,7 +828,7 @@
 			return;
 		}
 		oldFilteredListener.markRemoved();
-		Collection<ListenerInfo> removedListeners = Collections.<ListenerInfo> singletonList(oldFilteredListener);
+		Collection<ListenerInfo> removedListeners = Collections.singletonList(oldFilteredListener);
 		notifyListenerHooks(removedListeners, false);
 	}
 
@@ -1080,8 +1080,7 @@
 			}
 
 			if ((result == null) || result.isEmpty()) {
-				List<ServiceRegistrationImpl<?>> empty = Collections.<ServiceRegistrationImpl<?>> emptyList();
-				return empty;
+				return Collections.emptyList();
 			}
 
 			result = new LinkedList<>(result); /* make a new list since we don't want to change the real list */
@@ -1117,8 +1116,7 @@
 		List<ServiceRegistrationImpl<?>> result = publishedServicesByContext.get(context);
 
 		if ((result == null) || result.isEmpty()) {
-			List<ServiceRegistrationImpl<?>> empty = Collections.<ServiceRegistrationImpl<?>> emptyList();
-			return empty;
+			return Collections.emptyList();
 		}
 
 		return new ArrayList<>(result); /* make a new list since we don't want to change the real list */
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ShrinkableCollection.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ShrinkableCollection.java
index f770d9d..728bcfb 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ShrinkableCollection.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ShrinkableCollection.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008, 2016 IBM Corporation and others.
+ * Copyright (c) 2008, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -14,7 +14,11 @@
 
 package org.eclipse.osgi.internal.serviceregistry;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
 
 /**
  * A Shrinkable Collection. This class provides a wrapper for a list of collections
@@ -40,7 +44,7 @@
 		if (c == null) {
 			throw new NullPointerException();
 		}
-		List<Collection<? extends E>> empty = Collections.<Collection<? extends E>> emptyList();
+		List<Collection<? extends E>> empty = Collections.emptyList();
 		list = empty;
 		collection = c;
 	}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/BundleInfo.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/BundleInfo.java
index 1d903dc..e23951d 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/BundleInfo.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/BundleInfo.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012, 2018 IBM Corporation and others.
+ * Copyright (c) 2012, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -85,7 +85,7 @@
 
 		Generation(long generationId) {
 			this.generationId = generationId;
-			this.cachedHeaders = new CachedManifest(this, Collections.<String, String> emptyMap());
+			this.cachedHeaders = new CachedManifest(this, Collections.emptyMap());
 		}
 
 		Generation(long generationId, File content, boolean isDirectory, Type contentType, boolean hasPackageInfo, Map<String, String> cached, long lastModified, boolean isMRJar) {
@@ -149,14 +149,14 @@
 						rawHeaders = Collections.emptyMap();
 					} else {
 						try {
-							Map<String, String> merged = ManifestElement.parseBundleManifest(manifest.getInputStream(), new CaseInsensitiveDictionaryMap<String, String>());
+							Map<String, String> merged = ManifestElement.parseBundleManifest(manifest.getInputStream(), new CaseInsensitiveDictionaryMap<>());
 							// For MRJARs only replace Import-Package and Require-Capability if the versioned values are non-null
 							if (Boolean.parseBoolean(merged.get(MULTI_RELEASE_HEADER))) {
 								for (int i = getStorage().getRuntimeVersion().getMajor(); i > 8; i--) {
 									String versionManifest = "META-INF/versions/" + i + "/OSGI-INF/MANIFEST.MF"; //$NON-NLS-1$ //$NON-NLS-2$
 									BundleEntry versionEntry = getBundleFile().getEntry(versionManifest);
 									if (versionEntry != null) {
-										Map<String, String> versioned = ManifestElement.parseBundleManifest(versionEntry.getInputStream(), new CaseInsensitiveDictionaryMap<String, String>());
+										Map<String, String> versioned = ManifestElement.parseBundleManifest(versionEntry.getInputStream(), new CaseInsensitiveDictionaryMap<>());
 										String versionedImport = versioned.get(Constants.IMPORT_PACKAGE);
 										String versionedRequireCap = versioned.get(Constants.REQUIRE_CAPABILITY);
 										if (versionedImport != null) {
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java
index 19f988b..81c924a 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012, 2020 IBM Corporation and others.
+ * Copyright (c) 2012, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -467,7 +467,7 @@
 	}
 
 	private Version findFrameworkVersion() {
-		Requirement osgiPackageReq = ModuleContainer.createRequirement(PackageNamespace.PACKAGE_NAMESPACE, Collections.singletonMap(Namespace.REQUIREMENT_FILTER_DIRECTIVE, "(" + PackageNamespace.PACKAGE_NAMESPACE + "=org.osgi.framework)"), Collections.<String, String> emptyMap()); //$NON-NLS-1$ //$NON-NLS-2$
+		Requirement osgiPackageReq = ModuleContainer.createRequirement(PackageNamespace.PACKAGE_NAMESPACE, Collections.singletonMap(Namespace.REQUIREMENT_FILTER_DIRECTIVE, "(" + PackageNamespace.PACKAGE_NAMESPACE + "=org.osgi.framework)"), Collections.emptyMap()); //$NON-NLS-1$ //$NON-NLS-2$
 		Collection<BundleCapability> osgiPackages = moduleContainer.getFrameworkWiring().findProviders(osgiPackageReq);
 		for (BundleCapability packageCapability : osgiPackages) {
 			if (packageCapability.getRevision().getBundle().getBundleId() == 0) {
@@ -1209,7 +1209,7 @@
 	}
 
 	public BundleFile createNestedBundleFile(String nestedDir, BundleFile bundleFile, Generation generation) {
-		return createNestedBundleFile(nestedDir, bundleFile, generation, Collections.<String> emptyList());
+		return createNestedBundleFile(nestedDir, bundleFile, generation, Collections.emptyList());
 	}
 
 	public BundleFile createNestedBundleFile(String nestedDir, BundleFile bundleFile, Generation generation, Collection<String> filterPrefixes) {
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/SystemBundleFile.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/SystemBundleFile.java
index c679185..ed49811 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/SystemBundleFile.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/SystemBundleFile.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2013, 2017 IBM Corporation and others.
+ * Copyright (c) 2013, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,9 @@
  *******************************************************************************/
 package org.eclipse.osgi.storage;
 
-import java.io.*;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
 import java.net.URL;
 import java.util.Enumeration;
 import java.util.Map;
@@ -102,7 +104,7 @@
 				URL url = manifests.nextElement();
 				try {
 					// check each manifest until we find one with the Eclipse-SystemBundle: true header
-					Map<String, String> headers = ManifestElement.parseBundleManifest(url.openStream(), new CaseInsensitiveDictionaryMap<String, String>());
+					Map<String, String> headers = ManifestElement.parseBundleManifest(url.openStream(), new CaseInsensitiveDictionaryMap<>());
 					if ("true".equals(headers.get(Storage.ECLIPSE_SYSTEMBUNDLE))) //$NON-NLS-1$
 						return url;
 				} catch (BundleException e) {
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/MRUBundleFileList.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/MRUBundleFileList.java
index 15d6ac9..799d08f 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/MRUBundleFileList.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/MRUBundleFileList.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2018 IBM Corporation and others.
+ * Copyright (c) 2005, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -63,7 +63,7 @@
 		if (fileLimit >= MIN) {
 			this.bundleFileList = new BundleFile[fileLimit];
 			this.useStampList = new long[fileLimit];
-			this.bundleFileCloser = Collections.<Object, Object> singletonMap(this, this);
+			this.bundleFileCloser = Collections.singletonMap(this, this);
 		} else {
 			this.bundleFileList = null;
 			this.useStampList = null;
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/NestedDirBundleFile.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/NestedDirBundleFile.java
index b37922b..100037a 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/NestedDirBundleFile.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/NestedDirBundleFile.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2018 IBM Corporation and others.
+ * Copyright (c) 2005, 2021 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -42,7 +42,7 @@
 	 * @param nestedDirName
 	 */
 	public NestedDirBundleFile(BundleFile baseBundlefile, String nestedDirName) {
-		this(baseBundlefile, nestedDirName, Collections.<String> emptyList());
+		this(baseBundlefile, nestedDirName, Collections.emptyList());
 	}
 
 	/**
diff --git a/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/ResolverImpl.java b/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/ResolverImpl.java
index ab48fd5..14e6635 100755
--- a/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/ResolverImpl.java
+++ b/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/ResolverImpl.java
@@ -18,19 +18,50 @@
  */
 package org.apache.felix.resolver;
 
-import java.security.*;
-import java.util.*;
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
 import java.util.Map.Entry;
-import java.util.concurrent.*;
+import java.util.Queue;
+import java.util.Set;
+import java.util.concurrent.CancellationException;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.FutureTask;
 import java.util.concurrent.atomic.AtomicReference;
-
 import org.apache.felix.resolver.reason.ReasonException;
 import org.apache.felix.resolver.util.ArrayMap;
 import org.apache.felix.resolver.util.CandidateSelector;
 import org.apache.felix.resolver.util.OpenHashMap;
-import org.osgi.framework.namespace.*;
-import org.osgi.resource.*;
-import org.osgi.service.resolver.*;
+import org.osgi.framework.namespace.BundleNamespace;
+import org.osgi.framework.namespace.ExecutionEnvironmentNamespace;
+import org.osgi.framework.namespace.HostNamespace;
+import org.osgi.framework.namespace.IdentityNamespace;
+import org.osgi.framework.namespace.PackageNamespace;
+import org.osgi.resource.Capability;
+import org.osgi.resource.Namespace;
+import org.osgi.resource.Requirement;
+import org.osgi.resource.Resource;
+import org.osgi.resource.Wire;
+import org.osgi.resource.Wiring;
+import org.osgi.service.resolver.HostedCapability;
+import org.osgi.service.resolver.ResolutionException;
+import org.osgi.service.resolver.ResolveContext;
+import org.osgi.service.resolver.Resolver;
 
 public class ResolverImpl implements Resolver
 {
@@ -325,7 +356,7 @@
 
         public Collection<Resource> getRelatedResources(Resource resource) {
             Collection<Resource> related =  m_relatedResources.get(resource);
-            return related == null ? Collections.<Resource> emptyList() : related;
+            return related == null ? Collections.emptyList() : related;
         }
 
         public void setRelatedResources(Resource resource, Collection<Resource> related) {
@@ -800,8 +831,8 @@
                 resourcePkgs,
                 wire.requirement,
                 wire.capability,
-                new HashSet<Capability>(),
-                new HashSet<Resource>());
+                new HashSet<>(),
+                new HashSet<>());
         }
 
         return resourcePkgs;
@@ -1811,7 +1842,7 @@
                 }
                 else
                 {
-                    sources.put(sourceCap, Collections.<Capability>emptySet());
+                    sources.put(sourceCap, Collections.emptySet());
                 }
             }
         }
@@ -1877,7 +1908,7 @@
         if (!session.getContext().getWirings().containsKey(unwrappedResource)
             && !wireMap.containsKey(unwrappedResource))
         {
-            wireMap.put(unwrappedResource, Collections.<Wire>emptyList());
+            wireMap.put(unwrappedResource, Collections.emptyList());
 
             List<Wire> packageWires = new ArrayList<>();
             List<Wire> bundleWires = new ArrayList<>();
@@ -1952,8 +1983,7 @@
                     // creating duplicate non-payload wires if the fragment
                     // is attached to more than one host.
                     List<Wire> fragmentWires = wireMap.get(fragment);
-                    fragmentWires = (fragmentWires == null)
-                        ? new ArrayList<>() : fragmentWires;
+                    fragmentWires = (fragmentWires == null) ? new ArrayList<>() : fragmentWires;
 
                     // Loop through all of the fragment's requirements and create
                     // any necessary wires for non-payload requirements.
@@ -2036,7 +2066,7 @@
         ResolveSession session, Map<Resource,
         List<Wire>> wireMap, Candidates allCandidates)
     {
-        wireMap.put(session.getDynamicHost(), Collections.<Wire>emptyList());
+        wireMap.put(session.getDynamicHost(), Collections.emptyList());
 
         List<Wire> packageWires = new ArrayList<>();
 
@@ -2250,7 +2280,7 @@
                 return Collections.emptySet();
             }
             Set<Capability> result = m_rootCauses.get(req);
-            return result == null ? Collections.<Capability>emptySet() : result;
+            return result == null ? Collections.emptySet() : result;
         }
 
         @Override
diff --git a/bundles/org.eclipse.osgi/osgi/src/org/osgi/dto/DTO.java b/bundles/org.eclipse.osgi/osgi/src/org/osgi/dto/DTO.java
index ffcb641..95caf5a 100644
--- a/bundles/org.eclipse.osgi/osgi/src/org/osgi/dto/DTO.java
+++ b/bundles/org.eclipse.osgi/osgi/src/org/osgi/dto/DTO.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2012, 2020). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2012, 2021). All Rights Reserved.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -53,8 +53,7 @@
 	 */
 	@Override
 	public String toString() {
-		return appendValue(new StringBuilder(),
-				new IdentityHashMap<Object,String>(), "#", this).toString();
+		return appendValue(new StringBuilder(), new IdentityHashMap<>(), "#", this).toString();
 	}
 
 	/**