This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jxpath.git

commit 7e9b7d8c1bd272ac60ba9683e0bf822bf7cc95d5
Author: Gary D. Gregory <[email protected]>
AuthorDate: Sun Mar 16 19:24:41 2025 -0400

    PageScopeContext.getAttributeNames() is now typed with generics
---
 src/changes/changes.xml                                             | 1 +
 .../java/org/apache/commons/jxpath/servlet/PageScopeContext.java    | 2 +-
 .../org/apache/commons/jxpath/servlet/PageScopeContextHandler.java  | 6 +++---
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 98d731b..bd75cbe 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -114,6 +114,7 @@ The <action> type attribute can be add,update,fix,remove.
       <action dev="ggregory" type="fix" due-to="Gary Gregory">Deprecate 
KeyManagerUtils.KeyManagerUtils().</action>
       <action dev="ggregory" type="fix" due-to="Gary Gregory">Deprecate 
TypeUtils.TypeUtils().</action>
       <action dev="ggregory" type="fix" due-to="Gary Gregory">Deprecate 
ValueUtils.ValueUtils().</action>
+      <action dev="ggregory" type="fix" due-to="Gary 
Gregory">PageScopeContext.getAttributeNames() is now typed with 
generics.</action>
       <!-- ADD -->
       <action issue="JXPATH-123" dev="mbenson" type="add">
         XPath function "ends-with" is not implemented (although "starts-with" 
is).
diff --git 
a/src/main/java/org/apache/commons/jxpath/servlet/PageScopeContext.java 
b/src/main/java/org/apache/commons/jxpath/servlet/PageScopeContext.java
index e2b5e83..de12428 100644
--- a/src/main/java/org/apache/commons/jxpath/servlet/PageScopeContext.java
+++ b/src/main/java/org/apache/commons/jxpath/servlet/PageScopeContext.java
@@ -53,7 +53,7 @@ public class PageScopeContext {
      * 
      * @return Enumeration of attribute names
      */
-    public Enumeration getAttributeNames() {
+    public Enumeration<String> getAttributeNames() {
         return pageContext.getAttributeNamesInScope(PageContext.PAGE_SCOPE);
     }
 
diff --git 
a/src/main/java/org/apache/commons/jxpath/servlet/PageScopeContextHandler.java 
b/src/main/java/org/apache/commons/jxpath/servlet/PageScopeContextHandler.java
index 551872f..c608030 100644
--- 
a/src/main/java/org/apache/commons/jxpath/servlet/PageScopeContextHandler.java
+++ 
b/src/main/java/org/apache/commons/jxpath/servlet/PageScopeContextHandler.java
@@ -36,12 +36,12 @@ public class PageScopeContextHandler implements 
DynamicPropertyHandler {
 
     @Override
     public String[] getPropertyNames(final Object pageScope) {
-        final Enumeration e = ((PageScopeContext) 
pageScope).getAttributeNames();
-        final ArrayList list = new ArrayList(DEFAULT_LIST_SIZE);
+        final Enumeration<String> e = ((PageScopeContext) 
pageScope).getAttributeNames();
+        final ArrayList<String> list = new ArrayList<>(DEFAULT_LIST_SIZE);
         while (e.hasMoreElements()) {
             list.add(e.nextElement());
         }
-        return (String[]) list.toArray(new String[list.size()]);
+        return list.toArray(new String[list.size()]);
     }
 
     @Override

Reply via email to