Skip to content

Commit fb8e5cf

Browse files
committedOct 18, 2021
8275368: Correct statement of kinds of elements Processor.process operates over
Reviewed-by: jlahoda
1 parent d548f2f commit fb8e5cf

File tree

2 files changed

+22
-15
lines changed

2 files changed

+22
-15
lines changed
 

‎src/java.compiler/share/classes/javax/annotation/processing/Processor.java

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -322,15 +322,16 @@ public interface Processor {
322322
void init(ProcessingEnvironment processingEnv);
323323

324324
/**
325-
* Processes a set of annotation interfaces on type elements
326-
* originating from the prior round and returns whether or not
327-
* these annotation interfaces are claimed by this processor. If {@code
328-
* true} is returned, the annotation interfaces are claimed and subsequent
329-
* processors will not be asked to process them; if {@code false}
330-
* is returned, the annotation interfaces are unclaimed and subsequent
331-
* processors may be asked to process them. A processor may
332-
* always return the same boolean value or may vary the result
333-
* based on its own chosen criteria.
325+
* Processes a set of annotation interfaces on {@linkplain
326+
* RoundEnvironment#getRootElements() root elements} originating
327+
* from the prior round and returns whether or not these
328+
* annotation interfaces are claimed by this processor. If {@code
329+
* true} is returned, the annotation interfaces are claimed and
330+
* subsequent processors will not be asked to process them; if
331+
* {@code false} is returned, the annotation interfaces are
332+
* unclaimed and subsequent processors may be asked to process
333+
* them. A processor may always return the same boolean value or
334+
* may vary the result based on its own chosen criteria.
334335
*
335336
* <p>The input set will be empty if the processor supports {@code
336337
* "*"} and the root elements have no annotations. A {@code

‎src/java.compiler/share/classes/javax/annotation/processing/RoundEnvironment.java

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,7 @@
2525

2626
package javax.annotation.processing;
2727

28-
import javax.lang.model.element.Element;
29-
import javax.lang.model.element.TypeElement;
28+
import javax.lang.model.element.*;
3029
import java.util.LinkedHashSet;
3130
import java.util.Collections;
3231
import java.util.Set;
@@ -58,8 +57,15 @@ public interface RoundEnvironment {
5857
boolean errorRaised();
5958

6059
/**
61-
* Returns the {@linkplain Processor root elements} for annotation processing generated
62-
* by the prior round.
60+
* Returns the {@linkplain Processor root elements} for annotation
61+
* processing {@linkplain Filer generated} by the prior round.
62+
*
63+
* @apiNote
64+
* Root elements correspond to the top-level declarations in
65+
* compilation units (JLS section {@jls 7.3}). Root elements are
66+
* most commonly {@linkplain TypeElement types}, but can also be
67+
* {@linkplain PackageElement packages} or {@linkplain
68+
* ModuleElement modules}.
6369
*
6470
* @return the root elements for annotation processing generated
6571
* by the prior round, or an empty set if there were none

0 commit comments

Comments
 (0)
Please sign in to comment.