Re: svn commit: r559282 - /xml/xindice/trunk/java/src/org/apache/xindice/core/indexer/IndexManager.java
Vadim Gritsenko <[email protected]>
| Newsgroups | gmane.text.xml.xindice.devel |
|---|---|
| Message-ID | <[email protected]> |
[email protected] wrote: > public void characters(char ch[], int start, int length) { > - String val = new String(ch).trim(); ... > + String val = new String(ch); > info.sb.append(val); Now, after I had a look at this piece, I realized that it was wrong then and it is still wrong now :) String must be constructed only from the relevant part of the character buffer: String val = new String(ch, start, length); Otherwise it can contain junk / extra data. It is a pure coincidence that it worked at all. :) Even better would be to forgo string construction completely and use append method: info.sb.append(ch, start, length); This would save one extra characters copying. Vadim