Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2020-07-27 10:13:12 +0000
committerLars Vogel2020-07-27 10:13:12 +0000
commita322e325eea5d1644656d915a87971bdaeb48670 (patch)
tree729ac1751c5d3c0e5988575c293778e96edfe34c
parent771b127cedee9dc58390fd64e211671c2a458830 (diff)
downloadrt.equinox.framework-a322e325eea5d1644656d915a87971bdaeb48670.tar.gz
rt.equinox.framework-a322e325eea5d1644656d915a87971bdaeb48670.tar.xz
rt.equinox.framework-a322e325eea5d1644656d915a87971bdaeb48670.zip
Bug 565572 - Use lambdas and method reference on rt.equinox.framework
For EclipseStarter and EclipseAppLauncher Change-Id: I1e90e57f802bfb490583dcabf7a8ae38c9453577 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java9
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java21
2 files changed, 12 insertions, 18 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java
index 7b41681b4..f99c95fe5 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java
@@ -1419,12 +1419,9 @@ public class EclipseStarter {
final Bundle systemBundle = context.getBundle();
for (Iterator<Runnable> it = shutdownHandlers.iterator(); it.hasNext();) {
final Runnable handler = it.next();
- BundleListener listener = new BundleListener() {
- @Override
- public void bundleChanged(BundleEvent event) {
- if (event.getBundle() == systemBundle && event.getType() == BundleEvent.STOPPED) {
- handler.run();
- }
+ BundleListener listener = event -> {
+ if (event.getBundle() == systemBundle && event.getType() == BundleEvent.STOPPED) {
+ handler.run();
}
};
context.addBundleListener(listener);
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java
index fef62dfc6..2836f03b4 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java
@@ -88,18 +88,15 @@ public class EclipseAppLauncher implements ApplicationLauncher {
// need a thread to kick the main thread when the framework stops
final Thread mainThread = Thread.currentThread();
final BundleContext mainContext = context;
- new Thread(new Runnable() {
- @Override
- public void run() {
- Framework framework = (Framework) mainContext.getBundle(Constants.SYSTEM_BUNDLE_LOCATION);
- try {
- framework.waitForStop(0);
- // framework is done; tell the main thread to stop
- mainThread.interrupt();
- } catch (InterruptedException e) {
- Thread.interrupted();
- // just exiting now
- }
+ new Thread((Runnable) () -> {
+ Framework framework = (Framework) mainContext.getBundle(Constants.SYSTEM_BUNDLE_LOCATION);
+ try {
+ framework.waitForStop(0);
+ // framework is done; tell the main thread to stop
+ mainThread.interrupt();
+ } catch (InterruptedException e) {
+ Thread.interrupted();
+ // just exiting now
}
}, "Framework watcher").start(); //$NON-NLS-1$

Back to the top