Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion api/src/main/java/jakarta/enterprise/event/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
* </p>
*
* <ul>
* <li>the <em>specified type</em> is the type parameter specified at the injection point, and</li>
* <li>the <em>specified type</em> is the type argument specified at the injection point, unless the type argument
* is a wildcard, in which case the specified type is the wildcard's bound, and</li>
* <li>the <em>specified qualifiers</em> are the qualifiers specified at the injection point.</li>
* </ul>
*
Expand Down
3 changes: 2 additions & 1 deletion api/src/main/java/jakarta/enterprise/inject/Instance.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
* </p>
*
* <ul>
* <li>the <em>required type</em> is the type parameter specified at the injection point, and</li>
* <li>the <em>required type</em> is the type argument specified at the injection point, unless the type argument
* is a wildcard, in which case the required type is the wildcard's bound, and</li>
* <li>the <em>required qualifiers</em> are the qualifiers specified at the injection point.</li>
* </ul>
*
Expand Down
8 changes: 4 additions & 4 deletions spec/src/main/asciidoc/core/events.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public interface Event<T> {

For an injected `Event`:

* the _specified type_ is the type parameter specified at the injection point, and
* the _specified type_ is the type argument specified at the injection point, unless the type argument is a wildcard, in which case the specified type is the wildcard's bound, and
* the _specified qualifiers_ are the qualifiers specified at the injection point.


Expand All @@ -167,9 +167,9 @@ Event<AdminLoggedInEvent> admin = any.select(

If the specified type contains a type variable, an `IllegalArgumentException` is thrown.

The specified type must not be a wildcard type.
If an injected `Event` has a specified type that is a wildcard type, the container treats it as a definition error.
If a programmatically obtained `Event` has a specified type that is a wildcard type, non-portable behavior results.
The specified type may be a wildcard type only if it has a lower bound.
If an injected `Event` has a specified type that is a wildcard type without lower bound, the container treats it as a definition error.
If a programmatically obtained `Event` has a specified type that is a wildcard type without lower bound, non-portable behavior results.

If two instances of the same non repeating qualifier type are passed to `select()`, an `IllegalArgumentException` is thrown.

Expand Down
8 changes: 4 additions & 4 deletions spec/src/main/asciidoc/core/injectionandresolution.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ public interface Instance<T> extends Iterable<T>, Provider<T> {

For an injected `Instance`:

* the _required type_ is the type parameter specified at the injection point, and
* the _required type_ is the type argument specified at the injection point, unless the type argument is a wildcard, in which case the required type is the wildcard's bound, and
* the _required qualifiers_ are the qualifiers specified at the injection point.


Expand All @@ -700,9 +700,9 @@ Instance<AsynchronousPaymentProcessor> async = anyPaymentProcessor.select(
AsynchronousPaymentProcessor.class, new AsynchronousQualifier() );
----

The required type must not be a wildcard type.
If an injected `Instance` has a required type that is either a wildcard type or an `Event` whose specified type is a wildcard type, the container treats it as a definition error.
If a programmatically obtained `Instance` has a required type that is a wildcard type, non-portable behavior results.
The required type may be a wildcard type only if it does not have a lower bound.
If an injected `Instance` has a required type that is either a wildcard type with lower bound or an `Event` whose specified type is a wildcard type without lower bound, the container treats it as a definition error.
If a programmatically obtained `Instance` has a required type that is a wildcard type with lower bound, non-portable behavior results.


If an injection point of raw type `Instance` is defined, the container automatically detects the problem and treats it as a definition error.
Expand Down