diff options
Diffstat (limited to 'bundles/org.eclipse.osgi/container/src')
8 files changed, 17 insertions, 13 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 |