Skip to content

Commit

Permalink
Convert to lambda in o.e.osgi
Browse files Browse the repository at this point in the history
  • Loading branch information
akurtakov committed Dec 15, 2023
1 parent bf62833 commit 33adea0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,9 @@ synchronized <K, V, E> EventThread<K, V, E> getEventThread() {
}
if (thread == null) {
/* if there is no thread, then create a new one */
thread = AccessController.doPrivileged(new PrivilegedAction<EventThread<K, V, E>>() {
@Override
public EventThread<K, V, E> run() {
EventThread<K, V, E> t = new EventThread<>(threadGroup, threadName);
return t;
}
thread = AccessController.doPrivileged((PrivilegedAction<EventThread<K, V, E>>) () -> {
EventThread<K, V, E> t = new EventThread<>(threadGroup, threadName);
return t;
});
/* start the new thread */
thread.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Boolean>() {
@Override
public Boolean run() {
return IGNORE.equals(System.getProperty(PROP_WARNINGS));
}
});
private static final boolean ignoreWarnings = AccessController
.doPrivileged((PrivilegedAction<Boolean>) () -> IGNORE.equals(System.getProperty(PROP_WARNINGS)));

/*
* NOTE do not change the name of this field; it is set by the Framework using reflection
Expand Down Expand Up @@ -152,12 +148,9 @@ public static void initializeMessages(final String baseName, final Class<?> claz
load(baseName, clazz);
return;
}
AccessController.doPrivileged(new PrivilegedAction<Void>() {
@Override
public Void run() {
load(baseName, clazz);
return null;
}
AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
load(baseName, clazz);
return null;
});
}

Expand Down

0 comments on commit 33adea0

Please sign in to comment.