From 943e07fa8178c85742a596617fb8a6a1d054a2e9 Mon Sep 17 00:00:00 2001 From: Ladislav Thon Date: Tue, 25 Apr 2023 17:13:56 +0200 Subject: [PATCH 1/4] add missing @since tags for some elements added in CDI 4.0 --- .../main/java/jakarta/enterprise/inject/spi/BeanContainer.java | 1 + .../main/java/jakarta/enterprise/inject/spi/ObserverMethod.java | 1 + 2 files changed, 2 insertions(+) diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/BeanContainer.java b/api/src/main/java/jakarta/enterprise/inject/spi/BeanContainer.java index cccc6ddc..eb620edb 100644 --- a/api/src/main/java/jakarta/enterprise/inject/spi/BeanContainer.java +++ b/api/src/main/java/jakarta/enterprise/inject/spi/BeanContainer.java @@ -37,6 +37,7 @@ * * * @author Matej Novotny + * @since 4.0 */ public interface BeanContainer { diff --git a/api/src/main/java/jakarta/enterprise/inject/spi/ObserverMethod.java b/api/src/main/java/jakarta/enterprise/inject/spi/ObserverMethod.java index dec726ed..ad57cbde 100644 --- a/api/src/main/java/jakarta/enterprise/inject/spi/ObserverMethod.java +++ b/api/src/main/java/jakarta/enterprise/inject/spi/ObserverMethod.java @@ -66,6 +66,7 @@ public interface ObserverMethod extends Prioritized { *

* * @return the declaring {@linkplain Bean bean} + * @since 4.0 */ default Bean getDeclaringBean() { return null; From 94a1509a7a8f5aba351796a7d53dd2e3e840d3ac Mon Sep 17 00:00:00 2001 From: Ladislav Thon Date: Tue, 25 Apr 2023 17:14:40 +0200 Subject: [PATCH 2/4] improve wording of event type assignability rules This paragraph used to have a few sentences that used terms from the bean type assignability part of the specification, which is inappropriate for this part of the specification. --- spec/src/main/asciidoc/core/events.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/src/main/asciidoc/core/events.asciidoc b/spec/src/main/asciidoc/core/events.asciidoc index b18fd183..5c9a1805 100644 --- a/spec/src/main/asciidoc/core/events.asciidoc +++ b/spec/src/main/asciidoc/core/events.asciidoc @@ -219,9 +219,9 @@ If the runtime type of the event object contains an unresolvable type variable, ==== Assignability of type variables, raw and parameterized types -An event type is considered assignable to a type variable if the event type is assignable to the upper bound, if any. +An event type is considered assignable to an observed event type that is a type variable if the event type is assignable to the upper bound of the type variable, if any. -A raw event type is considered assignable to a parameterized observed event type if the raw types are identical and all type parameters of the required type are either unbounded type variables or `java.lang.Object`. +A raw event type is considered assignable to a parameterized observed event type if the raw types are identical and all type parameters of the observed event type are either unbounded type variables or `java.lang.Object`. A parameterized event type is considered assignable to a raw observed event type if the raw types are identical. From 6155757fe3a1bc51178ef30b8fa49af114271df2 Mon Sep 17 00:00:00 2001 From: Ladislav Thon Date: Tue, 25 Apr 2023 17:17:30 +0200 Subject: [PATCH 3/4] make the section about interceptors with disposer methods more precise --- spec/src/main/asciidoc/core/implementation.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/src/main/asciidoc/core/implementation.asciidoc b/spec/src/main/asciidoc/core/implementation.asciidoc index f4611cc5..4b41305b 100644 --- a/spec/src/main/asciidoc/core/implementation.asciidoc +++ b/spec/src/main/asciidoc/core/implementation.asciidoc @@ -379,7 +379,7 @@ If a method has more than one parameter annotated `@Disposes`, the container aut If a disposer method is annotated `@Produces` or `@Inject`, has a parameter annotated `@Observes` or has a parameter annotated `@ObservesAsync`, the container automatically detects the problem and treats it as a definition error. Interceptors may not declare disposer methods. -If an interceptor has a method annotated `@Disposes`, the container automatically detects the problem and treats it as a definition error. +If an interceptor has a method that has a parameter annotated `@Disposes`, the container automatically detects the problem and treats it as a definition error. In addition to the disposed parameter, a disposer method may declare additional parameters, which may also specify qualifiers. These additional parameters are injection points. From 9be8fd096deac7d626991d34cb238dafc8c0c492 Mon Sep 17 00:00:00 2001 From: Ladislav Thon Date: Tue, 25 Apr 2023 17:19:17 +0200 Subject: [PATCH 4/4] use a more appropriate link to the enablement section in CDI Full --- spec/src/main/asciidoc/core/inheritance_full.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/src/main/asciidoc/core/inheritance_full.asciidoc b/spec/src/main/asciidoc/core/inheritance_full.asciidoc index dec2836a..15170b66 100644 --- a/spec/src/main/asciidoc/core/inheritance_full.asciidoc +++ b/spec/src/main/asciidoc/core/inheritance_full.asciidoc @@ -128,7 +128,7 @@ public class MockAsynchronousService extends AsynchronousService { } ---- -When an enabled bean, as defined in <>, specializes a second bean, we can be certain that the second bean is never instantiated or called by the container. +When an enabled bean, as defined in <>, specializes a second bean, we can be certain that the second bean is never instantiated or called by the container. Even if the second bean defines a producer or observer method, the method will never be called. [[direct_and_indirect_specialization]]