Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleCapability.java8
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolver.java4
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRevisions.java2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxConfiguration.java2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/OSGiFrameworkHooks.java5
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/BundleLoader.java2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/PermissionInfoCollection.java2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ServiceRegistry.java5
-rw-r--r--bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/CopyOnWriteIdentityMap.java4
9 files changed, 19 insertions, 15 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleCapability.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleCapability.java
index 0da9f66e5..7cda53fd0 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleCapability.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleCapability.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2016 IBM Corporation and others.
+ * Copyright (c) 2012, 2020 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.container;
-import java.util.*;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
import org.osgi.framework.namespace.NativeNamespace;
import org.osgi.framework.wiring.BundleCapability;
@@ -32,7 +34,7 @@ public final class ModuleCapability implements BundleCapability {
this.namespace = namespace;
this.directives = directives;
this.attributes = attributes;
- this.transientAttrs = NativeNamespace.NATIVE_NAMESPACE.equals(namespace) ? new HashMap<String, Object>(0) : null;
+ this.transientAttrs = NativeNamespace.NATIVE_NAMESPACE.equals(namespace) ? new HashMap<>(0) : null;
this.revision = revision;
}
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 778a9cee5..c6c4d481a 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2017 IBM Corporation and others.
+ * Copyright (c) 2012, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -1189,7 +1189,7 @@ final class ModuleResolver {
private void computeUnresolvedProviderResolutionReportEntries(Map<Resource, List<Wire>> resolution) {
// Create a collection representing the resources asked to be
// resolved.
- Collection<Resource> shouldHaveResolvedResources = new ArrayList<Resource>(unresolved);
+ Collection<Resource> shouldHaveResolvedResources = new ArrayList<>(unresolved);
// Remove disabled resources.
shouldHaveResolvedResources.removeAll(disabled);
// Remove resolved resources, if necessary. The resolution will be
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRevisions.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRevisions.java
index f298dec8a..29e9a5631 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRevisions.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRevisions.java
@@ -60,7 +60,7 @@ public final class ModuleRevisions implements BundleRevisions {
@Override
public List<BundleRevision> getRevisions() {
synchronized (monitor) {
- return new ArrayList<BundleRevision>(revisions);
+ return new ArrayList<>(revisions);
}
}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxConfiguration.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxConfiguration.java
index 1781fc0cb..1b0bdbfdc 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxConfiguration.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxConfiguration.java
@@ -266,7 +266,7 @@ public class EquinoxConfiguration implements EnvironmentInfo {
public ConfigValues(Map<String, ?> initialConfiguration, Map<Throwable, Integer> exceptions) {
this.exceptions = exceptions;
- this.initialConfig = initialConfiguration == null ? new HashMap<String, Object>(0) : new HashMap<>(initialConfiguration);
+ this.initialConfig = initialConfiguration == null ? new HashMap<>(0) : new HashMap<>(initialConfiguration);
Object useSystemPropsValue = initialConfig.get(PROP_USE_SYSTEM_PROPERTIES);
this.useSystemProperties = useSystemPropsValue == null ? false : Boolean.parseBoolean(useSystemPropsValue.toString());
Properties tempConfiguration = useSystemProperties ? EquinoxContainer.secureAction.getProperties() : new Properties();
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 feed04ded..c1e5b25b2 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, 2017 IBM Corporation and others.
+ * Copyright (c) 2012, 2020 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,8 @@ class OSGiFrameworkHooks {
BundleContextImpl context = (BundleContextImpl) EquinoxContainer.secureAction.getContext(systemModule.getBundle());
ServiceReferenceImpl<ResolverHookFactory>[] refs = getHookReferences(registry, context);
- List<HookReference> hookRefs = refs == null ? Collections.<CoreResolverHookFactory.HookReference> emptyList() : new ArrayList<CoreResolverHookFactory.HookReference>(refs.length);
+ List<HookReference> hookRefs = refs == null ? Collections.<CoreResolverHookFactory.HookReference>emptyList()
+ : new ArrayList<>(refs.length);
if (refs != null) {
for (ServiceReferenceImpl<ResolverHookFactory> hookRef : refs) {
ResolverHookFactory factory = EquinoxContainer.secureAction.getService(hookRef, context);
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 b58432099..886b0f248 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
@@ -174,7 +174,7 @@ public class BundleLoader extends ModuleLoader {
// init the provided packages set
exportSources = new BundleLoaderSources(this);
List<ModuleCapability> exports = wiring.getModuleCapabilities(PackageNamespace.PACKAGE_NAMESPACE);
- exports = exports == null ? new ArrayList<ModuleCapability>(0) : exports;
+ exports = exports == null ? new ArrayList<>(0) : exports;
exportedPackages = Collections.synchronizedCollection(exports.size() > 10 ? new HashSet<String>(exports.size()) : new ArrayList<String>(exports.size()));
initializeExports(exports, exportSources, exportedPackages);
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/PermissionInfoCollection.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/PermissionInfoCollection.java
index e6635428a..07ed021a0 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/PermissionInfoCollection.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/PermissionInfoCollection.java
@@ -58,7 +58,7 @@ public final class PermissionInfoCollection extends PermissionCollection {
}
}
this.hasAllPermission = tempAllPermissions;
- this.cachedRelativeFilePermissionCollections = allAbsolutePaths ? null : new HashMap<BundlePermissions, PermissionCollection>();
+ this.cachedRelativeFilePermissionCollections = allAbsolutePaths ? null : new HashMap<>();
setReadOnly(); // collections are managed with ConditionalPermissionAdmin
}
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 4cdcd976d..8207c650e 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
@@ -401,7 +401,7 @@ public class ServiceRegistry {
// The the removals from the hooks are ignored for the system bundle
copyReferences = new ArrayList<>(references);
}
- Collection<ServiceReference<?>> shrinkable = new ShrinkableCollection<ServiceReference<?>>(copyReferences);
+ Collection<ServiceReference<?>> shrinkable = new ShrinkableCollection<>(copyReferences);
notifyFindHooks(context, clazz, filterstring, allservices, shrinkable);
int size = references.size();
@@ -906,7 +906,8 @@ public class ServiceRegistry {
Collection<BundleContext> contexts = asBundleContexts(listenerSnapshot.keySet());
notifyEventHooksPrivileged(event, contexts);
if (!listenerSnapshot.isEmpty()) {
- Map<BundleContext, Collection<ListenerInfo>> listeners = new ShrinkableValueCollectionMap<BundleContext, ListenerInfo>(listenerSnapshot);
+ Map<BundleContext, Collection<ListenerInfo>> listeners = new ShrinkableValueCollectionMap<>(
+ listenerSnapshot);
notifyEventListenerHooksPrivileged(event, listeners);
}
// always add back the system service listeners if they were removed
diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/CopyOnWriteIdentityMap.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/CopyOnWriteIdentityMap.java
index 4dfa81b22..dd381eeef 100644
--- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/CopyOnWriteIdentityMap.java
+++ b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/CopyOnWriteIdentityMap.java
@@ -132,7 +132,7 @@ public class CopyOnWriteIdentityMap<K, V> implements Map<K, V> {
Iterator<? extends Map.Entry<? extends K, ? extends V>> iter = source.entrySet().iterator();
for (int i = 0; i < sourceSize; i++) {
Map.Entry<? extends K, ? extends V> mapEntry = iter.next();
- toCopy[i] = new Entry<K, V>(mapEntry.getKey(), mapEntry.getValue());
+ toCopy[i] = new Entry<>(mapEntry.getKey(), mapEntry.getValue());
}
putAll(toCopy);
}
@@ -151,7 +151,7 @@ public class CopyOnWriteIdentityMap<K, V> implements Map<K, V> {
@SuppressWarnings("unchecked")
Entry<K, V>[] toCopy = new Entry[sourceSize];
for (int i = 0; i < sourceSize; i++) {
- toCopy[i] = new Entry<K, V>(keys[i], null);
+ toCopy[i] = new Entry<>(keys[i], null);
}
putAll(toCopy);
}

Back to the top