UnusedAnonymousClass
Instance created but never used

Severity
ERROR

The problem

Creating a side-effect-free anonymous class and never using it is usually a mistake.

For example:

public static void main(String[] args) {
  new Thread(new Runnable() {
    @Override public void run() {
      preventMissionCriticalDisasters();
    }
  }); // did you mean to call Thread#start()?
}

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("UnusedAnonymousClass") to the enclosing element.