Back to Intellij Community

NonFinalFieldOfException

java/java-impl/resources/inspectionDescriptions/NonFinalFieldOfException.html

2025.3-rc-2380 B
Original Source

Reports fields in subclasses of java.lang.Exception that are not declared final.

Data on exception objects should not be modified because this may result in losing the error context for later debugging and logging.

Example:

public class EditorException extends Exception {
    private String message; // warning: Non-final field 'message' of exception class
  }