JDK-8314437 : Release Note: New `javac` Warning When Calling Overridable Methods in Constructors
  • Type: Sub-task
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 21
  • Priority: P4
  • Status: Resolved
  • Resolution: Delivered
  • Submitted: 2023-08-16
  • Updated: 2023-08-17
  • Resolved: 2023-08-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 21
21Resolved
Description
The new lint option, `this-escape`, has been added to `javac` to warn about calls to overridable methods in the constructor body which might result in access to a partially constructed object from subclasses.

The new warning can be suppressed using `SuppressWarnings("this-escape")`.