Incorrect behavior in Saxon-HE-9.8.0-3 (maven)
Added by Vladimir Nesterovsky over 7 years ago
net.sf.saxon.style.PrincipalStylesheetModule contains a following code:
public void registerImplicitModes(StyleElement element, RuleManager manager) {
if (element instanceof XSLTemplate || element instanceof XSLApplyTemplates) {
String modeAtt = element.getAttributeValue("mode");
if (modeAtt != null) {
String[] tokens = Whitespace.trim(modeAtt).split(" \t\n\r");
for (String s : tokens) {
at the same time, please take a look at a signature of String.split() method:
public String[] split(String regex) {
return split(regex, 0);
}
I doubt you meant to split string on such a separator.
Replies (3)
Please register to reply
RE: Incorrect behavior in Saxon-HE-9.8.0-3 (maven) - Added by Michael Kay over 7 years ago
Thanks for pointing it out.
A similar coding error to https://saxonica.plan.io/issues/3264
Do you have a test case that breaks as a result of this error, so we can verify the fix?
RE: Incorrect behavior in Saxon-HE-9.8.0-3 (maven) - Added by Vladimir Nesterovsky over 7 years ago
Not a simple one. The primary manifestation was significant performance impact between versions, as the code registerImplicitModes() has a line: StructuredQName modeName = element.makeQName(s);
which throws an exception (many exceptions in our case) for a multi-mode string value. I did not trace consequences though.
RE: Incorrect behavior in Saxon-HE-9.8.0-3 (maven) - Added by Michael Kay over 7 years ago
See https://saxonica.plan.io/issues/3354
I came to the conclusion that the bug has no observable consequences.
Please register to reply