-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement
Milestone
Description
Leo Arnold opened SPR-13713 and commented
I reviewed the code of org.springframework.util.xml.SimpleNamespaceContext
and found that it does not implement several features required by the documentation of javax.xml.namespace.NamespaceContext
as per Java 8:
- The iterator returned by
getPrefixes(namespaceURI)
is modifiable, but should not be. - Missing null check:
getPrefix(null)
does not throwIllegalArgumentException
- Calling
getPrefixes(namespaceURI)
after aclear()
can yield a non-empty iterator, because the mapnamespaceUriToPrefixes
has not been cleared.
I would like to submit a pull request containing the following changes:
- Update unit tests to ensure implementation of the full contract
- Add/improve unit tests for all methods
- Rewrite all assertions with Hamcrest's
assertThat
for type safety and better error messages when tests are failing - Fix implementation of
SimpleNamespaceContext
to make unit tests pass - Rename private method
getPrefixesInternal
togetPrefixesList
as a more telling name
No functionality will be added or removed.
Affects: 4.2.2
1 votes, 4 watchers
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement