The following classes are reported by this inspection:
ThreadLocal
which have an initialValue()
method (can be replaced with ThreadLocal.withInitial
)Thread
which have a run()
method (can be replaced with new Thread(Runnable)
Example:
new Thread() {
@Override
public void run() {
System.out.println("Hello from thread!");
}
}.start();
After the quick-fix is applied:
new Thread(() -> {
System.out.println("Hello from thread!");
}).start();