diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/EventManager.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/EventManager.java index 2de9e8fe465..151f1fb2669 100644 --- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/EventManager.java +++ b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/eventmgr/EventManager.java @@ -194,12 +194,9 @@ synchronized EventThread getEventThread() { } if (thread == null) { /* if there is no thread, then create a new one */ - thread = AccessController.doPrivileged(new PrivilegedAction>() { - @Override - public EventThread run() { - EventThread t = new EventThread<>(threadGroup, threadName); - return t; - } + thread = AccessController.doPrivileged((PrivilegedAction>) () -> { + EventThread t = new EventThread<>(threadGroup, threadName); + return t; }); /* start the new thread */ thread.start(); diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/util/NLS.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/util/NLS.java index 0852d630e59..f0ce26bda21 100644 --- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/util/NLS.java +++ b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/util/NLS.java @@ -64,12 +64,8 @@ public abstract class NLS { private static String[] nlSuffixes; private static final String PROP_WARNINGS = "osgi.nls.warnings"; //$NON-NLS-1$ private static final String IGNORE = "ignore"; //$NON-NLS-1$ - private static final boolean ignoreWarnings = AccessController.doPrivileged(new PrivilegedAction() { - @Override - public Boolean run() { - return IGNORE.equals(System.getProperty(PROP_WARNINGS)); - } - }); + private static final boolean ignoreWarnings = AccessController + .doPrivileged((PrivilegedAction) () -> IGNORE.equals(System.getProperty(PROP_WARNINGS))); /* * NOTE do not change the name of this field; it is set by the Framework using reflection @@ -152,12 +148,9 @@ public static void initializeMessages(final String baseName, final Class claz load(baseName, clazz); return; } - AccessController.doPrivileged(new PrivilegedAction() { - @Override - public Void run() { - load(baseName, clazz); - return null; - } + AccessController.doPrivileged((PrivilegedAction) () -> { + load(baseName, clazz); + return null; }); }