Skip to content

Commit

Permalink
Clarify how @discovery and @enhancement participate in type discovery
Browse files Browse the repository at this point in the history
The terms "type discovery" and "bean discovery" are sometimes used
interchangeably, though they really shouldn't. This commit improves
the usage of these terms in `@Discovery` and `@Enhancement`.
In particular, the `@Enhancement` wording is changed to refer to
"type discovery" instead of "bean discovery", because bean discovery
happens _after_ `@Enhancement`.
  • Loading branch information
Ladicek committed Nov 29, 2021
1 parent a63aa70 commit 560f832
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Expand Up @@ -7,7 +7,7 @@

/**
* 1st phase of {@linkplain BuildCompatibleExtension build compatible extension} execution.
* Allow registering additional classes to be scanned during bean discovery.
* Allow adding additional classes to the set of types discovered during type discovery.
* Also allows registering custom CDI meta-annotations.
* <p>
* Methods annotated {@code @Discovery} may declare parameters of these types:
Expand Down
Expand Up @@ -13,7 +13,7 @@
* In the following text, the term <em>expected types</em> denotes the set of types defined by
* the {@link #types() types}, {@link #withSubtypes() withSubtypes} and {@link #withAnnotations() withAnnotations}
* members of the {@code @Enhancement} annotation. The term <em>discovered types</em> denotes
* the subset of <em>expected types</em> that were discovered during bean discovery.
* the subset of <em>expected types</em> that were discovered during type discovery.
* <p>
* Methods annotated {@code @Enhancement} must declare exactly one parameter of one of these types:
* <ul>
Expand Down
@@ -1,14 +1,16 @@
package jakarta.enterprise.inject.build.compatible.spi;

/**
* Allows registering additional classes to be scanned during bean discovery.
* Annotations on these classes can later be transformed using {@link Enhancement @Enhancement}.
* Allows adding additional classes to the set of types discovered during type discovery.
* Such classes will therefore be scanned during bean discovery. Annotations on these classes
* can later be transformed using {@link Enhancement @Enhancement}.
*
* @since 4.0
*/
public interface ScannedClasses {
/**
* Adds a class with given name to the set of classes to be scanned during bean discovery.
* Adds a class with given name to the set of types discovered during type discovery.
* The class will therefore be scanned during bean discovery.
*
* @param className binary name of the class, as defined by <cite>The Java&trade; Language Specification</cite>;
* in other words, the class name as returned by {@link Class#getName()}
Expand Down

0 comments on commit 560f832

Please sign in to comment.