Skip to content

Commit c3008da

Browse files
committed
Functions.getUsedNamespaces() is now typed with generics
1 parent df44300 commit c3008da

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

src/changes/changes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ The <action> type attribute can be add,update,fix,remove.
115115
<action dev="ggregory" type="fix" due-to="Gary Gregory">Deprecate TypeUtils.TypeUtils().</action>
116116
<action dev="ggregory" type="fix" due-to="Gary Gregory">Deprecate ValueUtils.ValueUtils().</action>
117117
<action dev="ggregory" type="fix" due-to="Gary Gregory">PageScopeContext.getAttributeNames() is now typed with generics.</action>
118+
<action dev="ggregory" type="fix" due-to="Gary Gregory">Functions.getUsedNamespaces() is now typed with generics.</action>
118119
<!-- ADD -->
119120
<action issue="JXPATH-123" dev="mbenson" type="add">
120121
XPath function "ends-with" is not implemented (although "starts-with" is).

src/main/java/org/apache/commons/jxpath/ClassFunctions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public Function getFunction(final String namespace, final String name, Object[]
111111
* @return a singleton
112112
*/
113113
@Override
114-
public Set getUsedNamespaces() {
114+
public Set<String> getUsedNamespaces() {
115115
return Collections.singleton(namespace);
116116
}
117117
}

src/main/java/org/apache/commons/jxpath/FunctionLibrary.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ private synchronized Map functionCache() {
5656
final int count = allFunctions.size();
5757
for (int i = 0; i < count; i++) {
5858
final Functions funcs = (Functions) allFunctions.get(i);
59-
final Set namespaces = funcs.getUsedNamespaces();
60-
for (final Iterator it = namespaces.iterator(); it.hasNext();) {
61-
final String ns = (String) it.next();
59+
final Set<String> namespaces = funcs.getUsedNamespaces();
60+
for (final Iterator<String> it = namespaces.iterator(); it.hasNext();) {
61+
final String ns = it.next();
6262
final Object candidates = byNamespace.get(ns);
6363
if (candidates == null) {
6464
byNamespace.put(ns, funcs);
@@ -109,7 +109,7 @@ public Function getFunction(final String namespace, final String name, final Obj
109109
* @return Set
110110
*/
111111
@Override
112-
public Set getUsedNamespaces() {
112+
public Set<String> getUsedNamespaces() {
113113
return functionCache().keySet();
114114
}
115115

src/main/java/org/apache/commons/jxpath/Functions.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
public interface Functions {
2727

2828
/**
29-
* Returns a Function, if any, for the specified namespace, name and parameter types.
29+
* Gets a Function, if any, for the specified namespace, name and parameter types.
3030
*
3131
* @param namespace ns
3232
* @param name function name
@@ -36,9 +36,9 @@ public interface Functions {
3636
Function getFunction(String namespace, String name, Object[] parameters);
3737

3838
/**
39-
* Returns all namespaces in which this function collection defines functions.
40-
*
41-
* @return Set
39+
* Gets all namespaces in which this function collection defines functions.
40+
*
41+
* @return all namespaces in which this function collection defines functions.
4242
*/
43-
Set getUsedNamespaces();
43+
Set<String> getUsedNamespaces();
4444
}

src/main/java/org/apache/commons/jxpath/PackageFunctions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public Function getFunction(final String namespace, final String name, Object[]
170170
* @return (singleton) namespace Set
171171
*/
172172
@Override
173-
public Set getUsedNamespaces() {
173+
public Set<String> getUsedNamespaces() {
174174
return Collections.singleton(namespace);
175175
}
176176
}

0 commit comments

Comments
 (0)