SANTUARIO-534 Fixed DOMNamespaceContext#23
SANTUARIO-534 Fixed DOMNamespaceContext#23peterdemaeyer wants to merge 1 commit intoapache:trunkfrom
Conversation
| @@ -0,0 +1,122 @@ | |||
| package org.apache.xml.security.utils; | |||
There was a problem hiding this comment.
Please add an Apache license header here.
|
|
||
| public String getNamespaceURI(String arg0) { | ||
| return namespaceMap.get(arg0); | ||
| public void setContext(Node context) { |
There was a problem hiding this comment.
Is this only used for testing? It would be better to remove it and make context final.
There was a problem hiding this comment.
It's only used in tests, but not "for testing".
The test "illustrates the intent".
It's not used here yet in production code, but it's going to be used in SANTUARIO-532, which is what I was referring to in my comment on the JIRA issue SANTUARIO-534:
- Added DOMNamespaceContext.setContext(Node context) to allow reusing a single instance with multiple Node contexts, in anticipation of using it in SANTUARIO-532.
If you insist I can remove it here, but I was hoping to keep it in anticipation of a future PR... It would be more hassle for me to remove it here (including the unit test that illustrates its purpose), and then having to reintroduce it later.
There was a problem hiding this comment.
OK if it's needed for the other PR then it's fine to leave it.
| for (Entry<String, String> entry : namespaceMap.entrySet()) { | ||
| if (entry.getValue().equals(arg0)) { | ||
| return entry.getKey(); | ||
| public String getNamespaceURI(String prefix) { |
There was a problem hiding this comment.
For getNamespaceURI, I'm wondering if it should be falling back to returning "" instead of return null? From the javadoc:
unbound prefix | XMLConstants.NULL_NS_URI("")
| /** | ||
| * @author Peter De Maeyer | ||
| */ |
b897aa9 to
a918d77
Compare
… contract correctly + settable context node
a918d77 to
6870144
Compare
Fixed
DOMNamespaceContextsuch that it correctly implements the contract defined byNamespaceContext+ made context node settable.