Integrated: 8356057: PrintingProcessor (-Xprint) does not print type variable bounds and type annotations for Object supertypes

Jan Lahoda jlahoda at openjdk.org
Tue May 13 04:46:58 UTC 2025


On Fri, 2 May 2025 11:37:40 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

> Consider code like:
> 
> import java.lang.annotation.*;
> 
> public class PrintingTest<T extends CharSequence> extends @TA Object {
> }
> 
> @Target(ElementType.TYPE_USE)
> @interface TA {}
> 
> 
> when using `-Xprint` to print this code, javac produces this:
> 
> public class PrintingTest<T> {
> 
>   public PrintingTest();
> }
> 
> @java.lang.annotation.Target({TYPE_USE})
> @interface TA {
> }
> 
> 
> Note the type variable is missing the bound, and the annotated supertype is missing. This PR proposes to change that to:
> 
> public class PrintingTest<T extends java.lang.CharSequence> extends java.lang. at TA Object {
> 
>   public PrintingTest();
> }
> 
> @java.lang.annotation.Target({TYPE_USE})
> @interface TA {
> }
> 
> 
> Please also review the CSR:
> https://bugs.openjdk.org/browse/JDK-8356058
> and the release note:
> https://bugs.openjdk.org/browse/JDK-8356062

This pull request has now been integrated.

Changeset: 24d77ade
Author:    Jan Lahoda <jlahoda at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/24d77adee9643c341d27366532c95923e1d97248
Stats:     243 lines in 6 files changed: 222 ins; 2 del; 19 mod

8356057: PrintingProcessor (-Xprint) does not print type variable bounds and type annotations for Object supertypes

Reviewed-by: darcy, vromero

-------------

PR: https://git.openjdk.org/jdk/pull/25002


More information about the compiler-dev mailing list