Reports exceptions that are declared in a method's signature but never thrown by the method itself or its implementations and derivatives.

The inspection ignores methods related to the serialization, for example methods readObject() or writeObject().

Example:


  void method() throws InterruptedException {
    System.out.println();
  }

The quick-fix removes unnecessary exceptions from the declaration and normalizes the redundant try-catch statements:

  void method() {
    System.out.println();
  }

Note: Some exceptions might not be reported during in-editor highlighting. For performance reasons, a non-private method is checked only when its name rarely occurs in the project. To see all results, run the inspection by selecting Analyze | Inspect Code... or Analyze | Run Inspection by Name... from the main menu.

Use the Ignore exceptions thrown by entry points methods option to ignore exceptions thrown by entry points methods. Entry points methods are configured the following inspection: Editor | Inspections | Java | Declaration redundancy | Unused declaration.