Inspectopedia 2025.3 Help

Overridable method called during object construction

Reports calls to overridable methods of the current class during object construction.

A method is called during object construction if it is inside a:

  • Constructor

  • Non-static instance initializer

  • Non-static field initializer

  • clone() method

  • readObject() method

  • readObjectNoData() method

Methods are overridable if they are not declared as final, static, or private. Package-local methods are considered safe, even though they are overridable. Such calls may result in subtle bugs, as object initialization may happen before the method call.

Example:

class Parent { void someMethod() { } } class Child extends Parent { Child() { someMethod(); } }

Locating this inspection

By ID

Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.

OverridableMethodCallDuringObjectConstruction
Via Settings dialog

Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.

Settings or Preferences | Editor | Inspections | Java | Initialization

This inspection shares the functionality with the following inspections:

  • Abstract method called during object construction

  • Overridden method called during object construction

Only one inspection should be enabled at once to prevent warning duplication.

Inspection ID: OverridableMethodCallDuringObjectConstruction

Suppressing Inspection

You can suppress this inspection by placing the following comment marker before the code fragment where you no longer want messages from this inspection to appear:

//noinspection OverridableMethodCallDuringObjectConstruction

More detailed instructions as well as other ways and options that you have can be found in the product documentation:

Inspection Details

By default bundled with:

IntelliJ IDEA 2025.3, Qodana for JVM 2025.3,

Last modified: 03 December 2025