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 228cca34..56e92f94 100644 --- a/api/src/main/java/jakarta/enterprise/inject/spi/ObserverMethod.java +++ b/api/src/main/java/jakarta/enterprise/inject/spi/ObserverMethod.java @@ -61,9 +61,16 @@ public interface ObserverMethod extends Prioritized { * For synthetic observers, the return value is undefined. *

* + *

+ * For the sake of compatibility with existing custom {@link ObserverMethod} implementations, this method by default + * returns {@code null}. + *

+ * * @return the declaring {@linkplain Bean bean} */ - public Bean getDeclaringBean(); + default Bean getDeclaringBean() { + return null; + } /** * Obtains the {@linkplain jakarta.enterprise.event observed event type}.