Add a check to see if the JAXP implementation understands JAXP 1.5 features#96
Merged
pitbulk merged 1 commit intoSAML-Toolkits:masterfrom Feb 14, 2017
Merged
Conversation
1.5. Concrete example is Xerces. Xerces does not support these features which will trigger an exception an cause the XML validation to always fail.
Contributor
Author
|
Since the method which is added tests compatibility with the running JVM / classpath I don't see how I could write an effective (ie. something that is not fragile) unit test for that. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added a check to see if the JAXP implementation understands features of JAXP 1.5. Concrete example of when this causes problems is when Xerces is on the classpath. Xerces does not support these features which will trigger an exception an cause the XML validation to always fail. When implementing the OneLogin SAML library in an application you don't always have the luxury of kicking Xerces out of the project ;-).
While checking for a string in an exception might seem odd it is actually the Oracle / Java recommended way. There is even a special documentation page for this exact issuet: https://docs.oracle.com/javase/tutorial/jaxp/properties/error.html . I guess Java 9 jigsaw should also be able to fix something like this. Since then the programmer can actually know which implementation version is present.
There are also other places on the net this issue is discussed. For example RedHat: https://access.redhat.com/solutions/1124603