Project

Profile

Help

Bug #1636

closed

java.lang.IllegalArgumentException: Unknown kind of CharSequence

Added by Michael Kay over 11 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Internals
Sprint/Milestone:
-
Start date:
2012-10-13
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

Reported by Gerrit Imsieke on the saxon-help list.

Internally, the problem occurs when appending a java.lang.StringBuffer to a net.sf.saxon.tree.tiny.LargeStringBuffer.

In the particular instance, the StringBuffer was constructed by the Unicode normalization library as a result of a call to normalize-unicode(). The problem in this case can be suppressed by disabling byte code generation, but that's accidental; in principle, it could occur on many other paths.

The primary solution is to allow LargeStringBuffer.append() to accept any kind of CharSequence, which is easily achieved by converting the supplied CharSequence (if of an unrecognized class) to a String.

Better performance can be obtained by converting the Unicode normalization library to use Saxon's FastStringBuffer in place of the standard Java StringBuffer.

A patch for 9.4 is being raised which will make the first change only. The second change will be made in the development branch.

Please register to edit this issue

Also available in: Atom PDF