Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ConnectTests.java38
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/ModuleContainerUsageTest.java4
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/security/BundleToJarInputStreamTest.java2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleContainer.java2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleContainerAdaptor.java2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/SecureAction.java4
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/connect/ConnectHookConfigurator.java5
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxContainerAdaptor.java2
-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/loader/buddy/GlobalPolicy.java4
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ServiceRegistrationImpl.java4
-rwxr-xr-xbundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/util/OpenHashMap.java2
12 files changed, 34 insertions, 37 deletions
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ConnectTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ConnectTests.java
index 4ca64c6dc..1dbf74eec 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ConnectTests.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ConnectTests.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
@@ -331,7 +331,7 @@ public class ConnectTests extends AbstractBundleTests {
public void testConnectFactoryNoModules() {
TestCountingModuleConnector connector = new TestCountingModuleConnector();
- doTestConnect(connector, Collections.emptyMap(), (f) -> {
+ doTestConnect(connector, Collections.emptyMap(), f -> {
try {
f.start();
f.stop();
@@ -343,7 +343,7 @@ public class ConnectTests extends AbstractBundleTests {
sneakyThrow(t);
}
});
- doTestConnect(connector, Collections.emptyMap(), (f) -> {
+ doTestConnect(connector, Collections.emptyMap(), f -> {
try {
f.start();
f.stop();
@@ -378,7 +378,7 @@ public class ConnectTests extends AbstractBundleTests {
}
};
- doTestConnect(activatorModuleConnector, Collections.emptyMap(), (f) -> {
+ doTestConnect(activatorModuleConnector, Collections.emptyMap(), f -> {
try {
f.start();
f.stop();
@@ -423,7 +423,7 @@ public class ConnectTests extends AbstractBundleTests {
}
};
- doTestConnect(activatorModuleConnector, Collections.emptyMap(), (f) -> {
+ doTestConnect(activatorModuleConnector, Collections.emptyMap(), f -> {
try {
f.start();
ServiceReference<Condition> trueCondition = trueConditionStart.get();
@@ -459,7 +459,7 @@ public class ConnectTests extends AbstractBundleTests {
config.put("k1", "v1");
config.put("k2", "v2");
- doTestConnect(initParamsModuleConnector, config, (f) -> {
+ doTestConnect(initParamsModuleConnector, config, f -> {
try {
f.init();
BundleContext bc = f.getBundleContext();
@@ -494,7 +494,7 @@ public class ConnectTests extends AbstractBundleTests {
connector.setModule(l, withManifest ? createSimpleManifestModule(l) : createSimpleHeadersModule(l));
}
- doTestConnect(connector, Collections.emptyMap(), (f) -> {
+ doTestConnect(connector, Collections.emptyMap(), f -> {
try {
f.init();
for (String l : locations) {
@@ -508,7 +508,7 @@ public class ConnectTests extends AbstractBundleTests {
}
});
- doTestConnect(connector, Collections.emptyMap(), (f) -> {
+ doTestConnect(connector, Collections.emptyMap(), f -> {
try {
f.init();
Bundle[] bundles = f.getBundleContext().getBundles();
@@ -527,7 +527,7 @@ public class ConnectTests extends AbstractBundleTests {
connector.setModule("b.2", null);
connector.setModule("b.3", BUNDLE_EXCEPTION);
- doTestConnect(connector, Collections.emptyMap(), (f) -> {
+ doTestConnect(connector, Collections.emptyMap(), f -> {
try {
f.init();
Bundle[] bundles = f.getBundleContext().getBundles();
@@ -590,7 +590,7 @@ public class ConnectTests extends AbstractBundleTests {
connector.setModule(id.toString(), createAdvancedModule(id, provideLoader));
}
- doTestConnect(connector, Collections.emptyMap(), (f) -> {
+ doTestConnect(connector, Collections.emptyMap(), f -> {
try {
f.start();
for (Integer id : ids) {
@@ -634,7 +634,7 @@ public class ConnectTests extends AbstractBundleTests {
connector.setModule(id.toString(), m);
}
- doTestConnect(connector, Collections.emptyMap(), (f) -> {
+ doTestConnect(connector, Collections.emptyMap(), f -> {
try {
f.start();
for (Integer id : ids) {
@@ -711,7 +711,7 @@ public class ConnectTests extends AbstractBundleTests {
TestConnectModule m = createSimpleHeadersModule(NAME1);
connector.setModule(NAME1, m);
- doTestConnect(connector, Collections.emptyMap(), (f) -> {
+ doTestConnect(connector, Collections.emptyMap(), f -> {
try {
f.start();
Bundle b = f.getBundleContext().installBundle(NAME1);
@@ -726,7 +726,7 @@ public class ConnectTests extends AbstractBundleTests {
FrameworkWiring fwkWiring = f.adapt(FrameworkWiring.class);
CountDownLatch refreshDone = new CountDownLatch(1);
- fwkWiring.refreshBundles(Collections.singletonList(b), (e) -> refreshDone.countDown());
+ fwkWiring.refreshBundles(Collections.singletonList(b), e -> refreshDone.countDown());
refreshDone.await();
// should still be NAME1
@@ -766,7 +766,7 @@ public class ConnectTests extends AbstractBundleTests {
TestCountingModuleConnector connector = new TestCountingModuleConnector();
TestConnectModule m = withManifest ? createSimpleManifestModule(NAME1) : createSimpleHeadersModule(NAME1);
connector.setModule(NAME1, m);
- doTestConnect(connector, Collections.emptyMap(), (f) -> {
+ doTestConnect(connector, Collections.emptyMap(), f -> {
try {
f.start();
Bundle b = f.getBundleContext().installBundle(NAME1);
@@ -803,7 +803,7 @@ public class ConnectTests extends AbstractBundleTests {
TestCountingModuleConnector connector = new TestCountingModuleConnector();
TestConnectModule m = createSimpleHeadersModule(NAME);
connector.setModule(NAME, m);
- doTestConnect(connector, Collections.emptyMap(), (f) -> {
+ doTestConnect(connector, Collections.emptyMap(), f -> {
try {
f.start();
Bundle b = f.getBundleContext().installBundle(NAME);
@@ -817,7 +817,7 @@ public class ConnectTests extends AbstractBundleTests {
});
doTestConnect(connector, Collections.singletonMap(HookRegistry.PROP_HOOK_CONFIGURATORS_EXCLUDE,
- "org.eclipse.equinox.weaving.hooks.WeavingHook"), (f) -> {
+ "org.eclipse.equinox.weaving.hooks.WeavingHook"), f -> {
try {
f.start();
Bundle b = f.getBundleContext().getBundle(NAME);
@@ -863,7 +863,7 @@ public class ConnectTests extends AbstractBundleTests {
TestConnectModule m = createSimpleHeadersModule(NAME1);
connector.setModule(NAME1, m);
- doTestConnect(connector, Collections.emptyMap(), (f) -> {
+ doTestConnect(connector, Collections.emptyMap(), f -> {
try {
f.start();
Bundle test = f.getBundleContext().installBundle(NAME1, in1);
@@ -918,7 +918,7 @@ public class ConnectTests extends AbstractBundleTests {
TestCountingModuleConnector connector = new TestCountingModuleConnector();
connector.setModule("javaExport", createJavaExportModule());
- doTestConnect(connector, Collections.emptyMap(), (f) -> {
+ doTestConnect(connector, Collections.emptyMap(), f -> {
try {
f.start();
Bundle b = f.getBundleContext().installBundle("javaExport");
@@ -926,7 +926,7 @@ public class ConnectTests extends AbstractBundleTests {
assertTrue("No java export found.",
b.adapt(BundleWiring.class).getCapabilities(PackageNamespace.PACKAGE_NAMESPACE).stream()
.findFirst()
- .map((c) -> "java.test.export"
+ .map(c -> "java.test.export"
.equals(c.getAttributes().get(PackageNamespace.PACKAGE_NAMESPACE)))
.orElse(false));
} catch (Throwable t) {
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/ModuleContainerUsageTest.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/ModuleContainerUsageTest.java
index 112f5579f..169d91a72 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/ModuleContainerUsageTest.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/container/ModuleContainerUsageTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2020 IBM Corporation and others.
+ * Copyright (c) 2020, 2021 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -186,7 +186,7 @@ public class ModuleContainerUsageTest extends AbstractTest {
Collection<BundleRequirement> eeBundleReqs = m.getCurrentRevision()
.getDeclaredRequirements(ExecutionEnvironmentNamespace.EXECUTION_ENVIRONMENT_NAMESPACE);
- eeBundleReqs.stream().findFirst().ifPresent((r) -> {
+ eeBundleReqs.stream().findFirst().ifPresent(r -> {
// notice that we depend on the available EEs
// to be ordered from least to greatest
for (BundleCapability ee : availableEEs) {
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/security/BundleToJarInputStreamTest.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/security/BundleToJarInputStreamTest.java
index 52ffb2f1d..faddec75f 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/security/BundleToJarInputStreamTest.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/security/BundleToJarInputStreamTest.java
@@ -91,7 +91,7 @@ public class BundleToJarInputStreamTest {
assertEquals("Expected manifest.", JarFile.MANIFEST_NAME, first.toUpperCase());
// If there are signature files, make sure they are before all other entries
AtomicReference<String> foundNonSignatureFile = new AtomicReference<>();
- validpaths.forEachRemaining((s) -> {
+ validpaths.forEachRemaining(s -> {
if (isSignatureFile(s)) {
assertNull("Found non signature file before.", foundNonSignatureFile.get());
} else {
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 4cc02eea3..ff86c6c00 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
@@ -1823,7 +1823,7 @@ public final class ModuleContainer implements DebugOptionsListener {
if (toStart.isEmpty()) {
return;
}
- final Executor executor = inParallel ? adaptor.getStartLevelExecutor() : command -> command.run();
+ final Executor executor = inParallel ? adaptor.getStartLevelExecutor() : Runnable::run;
final CountDownLatch done = new CountDownLatch(toStart.size());
for (final Module module : toStart) {
executor.execute(() -> {
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleContainerAdaptor.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleContainerAdaptor.java
index cf6cf6765..6d73c42d3 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleContainerAdaptor.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleContainerAdaptor.java
@@ -29,7 +29,7 @@ import org.osgi.framework.startlevel.FrameworkStartLevel;
* @since 3.10
*/
public abstract class ModuleContainerAdaptor {
- private static Executor defaultExecutor = command -> command.run();
+ private static Executor defaultExecutor = Runnable::run;
/**
* Event types that may be {@link #publishContainerEvent(ContainerEvent, Module, Throwable, FrameworkListener...) published}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/SecureAction.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/SecureAction.java
index 62d566e6a..2b6113bad 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/SecureAction.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/SecureAction.java
@@ -68,7 +68,7 @@ public class SecureAction {
* @return a privileged action object that can be used to construct a SecureAction object.
*/
public static PrivilegedAction<SecureAction> createSecureAction() {
- return () -> new SecureAction();
+ return SecureAction::new;
}
/**
@@ -91,7 +91,7 @@ public class SecureAction {
public Properties getProperties() {
if (System.getSecurityManager() == null)
return System.getProperties();
- return AccessController.doPrivileged((PrivilegedAction<Properties>) () -> System.getProperties(), controlContext);
+ return AccessController.doPrivileged((PrivilegedAction<Properties>) System::getProperties, controlContext);
}
/**
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/connect/ConnectHookConfigurator.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/connect/ConnectHookConfigurator.java
index aaf97974a..8d58f96c9 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/connect/ConnectHookConfigurator.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/connect/ConnectHookConfigurator.java
@@ -151,8 +151,7 @@ public class ConnectHookConfigurator implements HookConfigurator {
bundlefile = chain.getBundleFile();
}
if (bundlefile instanceof ConnectBundleFile) {
- return ((ConnectBundleFile) bundlefile).getClassLoader().map((l) //
- -> new DelegatingConnectClassLoader(parent, configuration, delegate, generation, l)).orElse(null);
+ return ((ConnectBundleFile) bundlefile).getClassLoader().map(l -> new DelegatingConnectClassLoader(parent, configuration, delegate, generation, l)).orElse(null);
}
}
return null;
@@ -161,7 +160,7 @@ public class ConnectHookConfigurator implements HookConfigurator {
hookRegistry.addActivatorHookFactory(() -> {
final List<BundleActivator> activators = new ArrayList<>();
- moduleConnector.newBundleActivator().ifPresent((a) -> activators.add(a));
+ moduleConnector.newBundleActivator().ifPresent(a -> activators.add(a));
return new BundleActivator() {
@Override
public void start(BundleContext context) throws Exception {
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 3bf21228b..01abd706a 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
@@ -128,7 +128,7 @@ public class EquinoxContainerAdaptor extends ModuleContainerAdaptor {
return () -> {
if (maxThreads == 1) {
// just do synchronous execution with current thread
- return command -> command.run();
+ return Runnable::run;
}
// Always want to create core threads until max size
int coreThreads = maxThreads;
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 22a4ff1ca..33ec54992 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
@@ -74,7 +74,7 @@ public class BundleLoader extends ModuleLoader {
public final static String DEFAULT_PACKAGE = "."; //$NON-NLS-1$
public final static String JAVA_PACKAGE = "java."; //$NON-NLS-1$
- public final static ClassContext CLASS_CONTEXT = AccessController.doPrivileged((PrivilegedAction<ClassContext>) () -> new ClassContext());
+ public final static ClassContext CLASS_CONTEXT = AccessController.doPrivileged((PrivilegedAction<ClassContext>) ClassContext::new);
public final static ClassLoader FW_CLASSLOADER = getClassLoader(EquinoxContainer.class);
private static final int PRE_CLASS = 1;
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 062cc8c48..a346ee2d8 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
@@ -61,9 +61,7 @@ public class GlobalPolicy implements IBuddyPolicy {
@Override
public URL loadResource(String name) {
return getExportingBundles(BundleLoader.getResourcePackageName(name)) //
- .stream().findFirst().map(b -> {
- return b.getResource(name);
- }).orElse(null);
+ .stream().findFirst().map(b -> b.getResource(name)).orElse(null);
}
@Override
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ServiceRegistrationImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ServiceRegistrationImpl.java
index 96d89dd8a..057d491ba 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ServiceRegistrationImpl.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ServiceRegistrationImpl.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
@@ -805,7 +805,7 @@ public class ServiceRegistrationImpl<S> implements ServiceRegistration<S>, Compa
S getSafeService(BundleContextImpl user, ServiceConsumer consumer) {
try {
S hook = getService(user, consumer);
- if (hookTypes.stream().filter((hookType) -> !hookType.isInstance(hook)).findFirst().isPresent()) {
+ if (hookTypes.stream().filter(hookType -> !hookType.isInstance(hook)).findFirst().isPresent()) {
// the hook impl is wired to a different hook package than the framework
if (hook != null) {
systemContext.ungetService(getReference());
diff --git a/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/util/OpenHashMap.java b/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/util/OpenHashMap.java
index 0d8d12dc6..f781de315 100755
--- a/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/util/OpenHashMap.java
+++ b/bundles/org.eclipse.osgi/felix/src/org/apache/felix/resolver/util/OpenHashMap.java
@@ -631,7 +631,7 @@ public class OpenHashMap<K, V> implements Serializable, Cloneable, SortedMap<K,
public Iterable<Map.Entry<K, V>> fast() {
if (fast == null) {
- fast = () -> new FastEntryIterator();
+ fast = FastEntryIterator::new;
}
return fast;

Back to the top