A static inner class does not keep an implicit reference to its enclosing instance. This prevents a common cause of memory leaks and uses less memory per class instance.
The quick-fix extracts the anonymous class into a named static inner class.
Example:
void sample(){
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
}
});
}
After the quick-fix is applied:
void sample(){
Thread thread = new Thread(new Task());
}
private static class Task implements Runnable {
@Override
public void run() {
}
}