This is an automated email from the ASF dual-hosted git repository.
veithen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ws-axiom.git
The following commit(s) were added to refs/heads/master by this push:
new 625520b0c Remove redundant condition
625520b0c is described below
commit 625520b0c68006e48da126178676d9f1f857a229
Author: Andreas Veithen <[email protected]>
AuthorDate: Mon Jan 12 11:52:35 2026 +0000
Remove redundant condition
OMElement extends OMContainer, which means that getNamespaceAxisIterator
only needs to check for OMElement. That makes sense because namespace
declarations only exist on elements.
---
.../src/main/java/org/apache/axiom/om/xpath/DocumentNavigator.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/axiom-api/src/main/java/org/apache/axiom/om/xpath/DocumentNavigator.java
b/axiom-api/src/main/java/org/apache/axiom/om/xpath/DocumentNavigator.java
index 3085e9fe0..31eb28fd7 100644
--- a/axiom-api/src/main/java/org/apache/axiom/om/xpath/DocumentNavigator.java
+++ b/axiom-api/src/main/java/org/apache/axiom/om/xpath/DocumentNavigator.java
@@ -366,10 +366,10 @@ public class DocumentNavigator extends DefaultNavigator {
@Override
public Iterator<?> getNamespaceAxisIterator(Object contextNode)
throws UnsupportedAxisException {
- if (!(contextNode instanceof OMContainer && contextNode instanceof
OMElement)) {
+ if (!(contextNode instanceof OMElement)) {
return JaxenConstants.EMPTY_ITERATOR;
}
- OMContainer omContextNode = (OMContainer) contextNode;
+ OMElement omContextNode = (OMElement) contextNode;
List<OMNamespaceEx> nsList = new ArrayList<OMNamespaceEx>();
Set<String> prefixes = new HashSet<String>();
for (OMContainer context = omContextNode;