Non-conformant XMLEventFactory.setLocation(null)
#204
Labels
pr-welcome
Issue for which progress most likely if someone submits a Pull Request
The Woodstox
XMLEventFactory
implementation producesXMLEvent
s with anull
location, whileXMLEvent.location
should never benull
.XMLEvent.getLocation():
XMLEventFactory.setLocation():
To reset the location information set the location to null – doesn't mean the events should end up with a null Location. Rather subsequent events would get an "unknown location" that may be a shared immutable object. This is the case before/without setting location information, also.
The values are copied by value into the events created by this factory – the properties from the given Location object are copied. The given Location object should not be used by reference unless the factory can identify it as an immutable type.
Steps to Reproduce
XMLEventFactoryTest.java
:Actual Behavior
Expected Behavior
The
WoodstoxNonVolatileLocation
type is just an example name suggesting it should be a Woodstox implementation.The full context of my original use case is JDK-8329424:
Even with the workaround for the JDK bug, when Woodstox is plugged in as the StAX provider, the subsequent transformation fails because of the events null location:
The text was updated successfully, but these errors were encountered: