diff --git a/api/src/main/java/jakarta/enterprise/event/Event.java b/api/src/main/java/jakarta/enterprise/event/Event.java index d692dbbff..cd0b5909e 100644 --- a/api/src/main/java/jakarta/enterprise/event/Event.java +++ b/api/src/main/java/jakarta/enterprise/event/Event.java @@ -73,7 +73,8 @@ *

* * * diff --git a/api/src/main/java/jakarta/enterprise/inject/Instance.java b/api/src/main/java/jakarta/enterprise/inject/Instance.java index 8a047361d..92749282f 100644 --- a/api/src/main/java/jakarta/enterprise/inject/Instance.java +++ b/api/src/main/java/jakarta/enterprise/inject/Instance.java @@ -73,7 +73,8 @@ *

* * * diff --git a/spec/src/main/asciidoc/core/events.asciidoc b/spec/src/main/asciidoc/core/events.asciidoc index a1aadb083..8ee60019b 100644 --- a/spec/src/main/asciidoc/core/events.asciidoc +++ b/spec/src/main/asciidoc/core/events.asciidoc @@ -142,7 +142,7 @@ public interface Event { 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. @@ -167,9 +167,9 @@ Event 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. diff --git a/spec/src/main/asciidoc/core/injectionandresolution.asciidoc b/spec/src/main/asciidoc/core/injectionandresolution.asciidoc index 578e85ae4..8a5877b9e 100644 --- a/spec/src/main/asciidoc/core/injectionandresolution.asciidoc +++ b/spec/src/main/asciidoc/core/injectionandresolution.asciidoc @@ -677,7 +677,7 @@ public interface Instance extends Iterable, Provider { 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. @@ -700,9 +700,9 @@ Instance 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.