JDK-8310067 : Restore javac manpage updates
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 21,22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-06-14
  • Updated: 2023-07-12
  • Resolved: 2023-06-19
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 JDK 22
21Fixed 22 b03Fixed
Related Reports
Relates :  
Relates :  
Description
JDK-8296656 and JDK-8015831 both updated the open javac nroff manpage - javac.1, but those changes were not applied to the closed markdown sources used to generate the nroff files. As a result regeneration of the nroff files loses those changes. The changes need to be applied to the markdown sources.
Comments
Missing changes from 8296656: diff --git a/src/jdk.compiler/share/man/javac.1 b/src/jdk.compiler/share/man/javac.1 index c9fcdb7d05c8..b28938d255a9 100644 --- a/src/jdk.compiler/share/man/javac.1 +++ b/src/jdk.compiler/share/man/javac.1 @@ -736,6 +736,9 @@ constructors in public and protected classes in exported packages. \f[V]options\f[R]: Warns about the issues relating to use of command line options. .IP \[bu] 2 +\f[V]output-file-clash\f[R]: Warns if any output file is overwritten during compilation. +This can occur, for example, on case-insensitive filesystems. +.IP \[bu] 2 \f[V]overloads\f[R]: Warns about the issues related to method overloads. .IP \[bu] 2 \f[V]overrides\f[R]: Warns about the issues related to method overrides. Missing changes from 8015831: diff --git a/src/jdk.compiler/share/man/javac.1 b/src/jdk.compiler/share/man/javac.1 index 945e9fd78f2d..9a7492911dd0 100644 --- a/src/jdk.compiler/share/man/javac.1 +++ b/src/jdk.compiler/share/man/javac.1 @@ -772,6 +772,9 @@ instances of value-based classes. \f[V]text-blocks\f[R]: Warns about inconsistent white space characters in text block indentation. .IP \[bu] 2 +\f[V]this-escape\f[R]: Warns about constructors leaking +\f[V]this\f[R] prior to subclass initialization. +.IP \[bu] 2 \f[V]try\f[R]: Warns about the issues relating to the use of try blocks (that is, try-with-resources). .IP \[bu] 2 @@ -2209,6 +2212,48 @@ Alternately, you can remove the \f[V]static\f[R] keyword from the declaration of the method \f[V]m1\f[R]. .RE .TP +\f[V]this\-escape\f[R] +Warns about constructors leaking \f[V]this\f[R] prior to subclass +initialization. +For example, this class: +.RS +.IP +.nf +\f[CB] +public class MyClass { + public MyClass() { + System.out.println(this.hashCode()); + } +} +\f[R] +.fi +.PP +generates the following warning: +.IP +.nf +\f[CB] +MyClass.java:3: warning: [this-escape] possible 'this' escape + before subclass is fully initialized + System.out.println(this.hashCode()); + ^ +\f[R] +.fi +.PP +A 'this' escape warning is generated when a constructor does something +that might result in a subclass method being invoked before the +constructor returns. +In such cases the subclass method would be operating on an incompletely +initialized instance. +In the above example, a subclass of \f[V]MyClass\f[R] that overrides +\f[V]hashCode()\f[R] to incorporate its own fields would likely produce +an incorrect result when invoked as shown. +.PP +Warnings are only generated if a subclass could exist that is outside +of the current module (or package, if no module) being compiled. +So, for example, constructors in final and non-public classes do not +generate warnings. +.RE +.TP \f[V]try\f[R] Warns about issues relating to the use of \f[V]try\f[R] blocks, including try-with-resources statements.
14-06-2023