From 3ce1240ca1b4139980444c171e317f4bfeff9314 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Mon, 12 Jun 2023 18:14:27 +0000 Subject: [PATCH] 8309870: Using -proc:full should be considered requesting explicit annotation processing Reviewed-by: jjg --- .../classes/com/sun/tools/javac/main/JavaCompiler.java | 5 ++++- .../share/classes/com/sun/tools/javac/main/Option.java | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java index a957b66b296..39d64bfdc42 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1288,7 +1288,10 @@ public class JavaCompiler { options.isSet(PROCESSOR_PATH) || options.isSet(PROCESSOR_MODULE_PATH) || options.isSet(PROC, "only") || + options.isSet(PROC, "full") || + options.isSet(A) || options.isSet(XPRINT); + // Skipping -XprintRounds and -XprintProcessorInfo } public void setDeferredDiagnosticHandler(Log.DeferredDiagnosticHandler deferredDiagnosticHandler) { diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java index de5997701a8..74f513a4af5 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -83,6 +83,11 @@ import static com.sun.tools.javac.main.Option.OptionKind.*; * {@code handleOption} then calls {@link #process process} providing a suitable * {@link OptionHelper} to provide access the compiler state. * + * + *

Maintenance note: when adding new annotation processing related + * options, the list of options regarded as requesting explicit + * annotation processing in JavaCompiler should be updated. + * *

This is NOT part of any supported API. * If you write code that depends on this, you do so at your own * risk. This code and its internal interfaces are subject to change