Fix #167 - Default implementation for ELResolver.getFeatureDescriptors()
diff --git a/api/src/main/java/jakarta/el/ELResolver.java b/api/src/main/java/jakarta/el/ELResolver.java
index ec3ba5a..8fa83f0 100644
--- a/api/src/main/java/jakarta/el/ELResolver.java
+++ b/api/src/main/java/jakarta/el/ELResolver.java
@@ -284,6 +284,10 @@
* The <code>propertyResolved</code> property of the <code>ELContext</code> is not relevant to this method. The results
* of all <code>ELResolver</code>s are concatenated in the case of composite resolvers.
*
+ * <p>
+ * The default implementation in {@link ELResolver} returns {@code null}. Sub-classes may wish to over-ride this
+ * method.
+ *
* @param context The context of this evaluation.
* @param base The base object whose set of valid properties is to be enumerated, or <code>null</code> to enumerate the
* set of top-level variables that this resolver can evaluate.
@@ -295,7 +299,9 @@
* @deprecated This method will be removed without replacement in EL 6.0
*/
@Deprecated(forRemoval = true, since = "5.0")
- public abstract Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base);
+ public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
+ return null;
+ }
/**
* Returns the most general type that this resolver accepts for the <code>property</code> argument, given a
diff --git a/spec/src/main/asciidoc/ELSpec.adoc b/spec/src/main/asciidoc/ELSpec.adoc
index 6758f1c..4efe55b 100644
--- a/spec/src/main/asciidoc/ELSpec.adoc
+++ b/spec/src/main/asciidoc/ELSpec.adoc
@@ -2984,6 +2984,11 @@
Clarify expected behaviour when matching expressions to methods based on
parameter types
+* https://github.com/eclipse-ee4j/el-ri/issues/167[#167]
+ Add a default implementation that returns `null` for the `ELResolver` method
+ `getFeatureDescriptors()` since it has been deprecated so that custom
+ `ELResolver` implementations do not need to implement the method.
+
=== Changes between 4.0 and JSR 341
* The API has moved from the `javax.el` package to the `jakarta.el`