Made a pass through the code to introduce lambdas / method references in the places the Android Studio suggested.

This commit is contained in:
Paul Hawke 2017-07-22 18:04:40 -05:00
parent 3824f31ef9
commit 4796557fb7
25 changed files with 206 additions and 374 deletions

View file

@ -9,11 +9,8 @@ public class BackgroundPoolExceptionHandler implements ExceptionHandler {
public void onException(@NonNull final Throwable t) {
//Crash for debug build
if (BuildConfig.DEBUG) {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
throw new RuntimeException(t);
}
Thread thread = new Thread(() -> {
throw new RuntimeException(t);
});
thread.start();
}

View file

@ -11,17 +11,13 @@ class ThreadFactoryMaker {
private int count = 0;
@Override
public Thread newThread(final Runnable runnable) {
public Thread newThread(@NonNull final Runnable runnable) {
count++;
Runnable wrapperRunnable = new Runnable() {
@Override
public void run() {
Process.setThreadPriority(priority);
runnable.run();
}
Runnable wrapperRunnable = () -> {
Process.setThreadPriority(priority);
runnable.run();
};
Thread t = new Thread(wrapperRunnable, String.format("%s-%s", name, count));
return t;
return new Thread(wrapperRunnable, String.format("%s-%s", name, count));
}
};
}