[PATCH] NamespaceAdder.addNamespace has suspect logic (jcr-commons/spi-commons)
-------------------------------------------------------------------------------
Key: JCR-1495
URL: https://issues.apache.org/jira/browse/JCR-1495
Project: Jackrabbit
Issue Type: Bug
Components: jackrabbit-spi-commons
Affects Versions: core 1.4.1
Reporter: Dave Brosius
Priority: Minor
Fix For: core 1.4.2
Attachments: suspect_namespaceadder.patch
Here's the method
public void addNamespaces(NamespaceMapping nsm)
throws NamespaceException,
UnsupportedRepositoryOperationException, RepositoryException {
Map m = nsm.getPrefixToURIMapping();
for (Iterator i = m.values().iterator(); i.hasNext();) {
Map.Entry e = (Map.Entry) i.next();
String prefix = (String) e.getKey();
String uri = (String) e.getKey();
registry.registerNamespace(prefix, uri);
}
}
should be the entrySet iterator, and uri should come from the value, patch
fixes this.
Occurs in both spi-commons and jcr-commons (duplicate code)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.