On Thu, 10 Jun 2021 15:28:16 GMT, Vicente Romero <vrom...@openjdk.org> wrote:
>> The ct.sym may contain classfiles referring to annotations that are not >> present in ct.sym (liek JDK's internal annotation `sun.misc.Contended`). If >> javac will try to load them (while discovering annotations for the purpose >> of detecting which annotation processors should be run), an error will be >> produced (please see the issue). The proposal is to strip annotations that >> are not present in ct.sym when generating ct.sym. > > make/langtools/src/classes/build/tools/symbolgenerator/CreateSymbols.java > line 311: > >> 309: private static final String PREVIEW_FEATURE_ANNOTATION_INTERNAL = >> 310: "Ljdk/internal/PreviewFeature+Annotation;"; >> 311: public static final Set<String> HARDCODED_ANNOTATIONS = new >> HashSet<>( > > shouldn't PREVIEW_FEATURE_ANNOTATION_INTERNAL be added to > HARDCODED_ANNOTATIONS too? The *_INTERNAL annotation(s) only exists in ct.sym and are injected after the annotations are filtered, so I think it does not need to be in `HARDCODED_ANNOTATION`. ------------- PR: https://git.openjdk.java.net/jdk/pull/4428