This seems similar to Bug 13796. The same workbook causes a similar, but different, error in the usermodel.examples.EventExample class (recompiled, unchanged, into my own package for simplicity). Namely: java.lang.reflect.InvocationTargetException: java.lang.StringIndexOutOfBoundsExc eption: String index out of range: 45 at java.lang.String.<init>(Unknown Source) at java.lang.String.<init>(Unknown Source) at org.apache.poi.hssf.record.formula.StringPtg.<init>(StringPtg.java:82 ) at org.apache.poi.hssf.record.formula.Ptg.createPtg(Ptg.java:244) at org.apache.poi.hssf.record.FormulaRecord.getParsedExpressionTokens(Fo rmulaRecord.java:171) at org.apache.poi.hssf.record.FormulaRecord.fillFields(FormulaRecord.jav a:147) at org.apache.poi.hssf.record.Record.fillFields(Record.java:143) at org.apache.poi.hssf.record.Record.<init>(Record.java:105) at org.apache.poi.hssf.record.FormulaRecord.<init>(FormulaRecord.java:11 8) at java.lang.reflect.Constructor.newInstance(Native Method) at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.j ava:252) at org.apache.poi.hssf.eventmodel.HSSFEventFactory.genericProcessEvents( HSSFEventFactory.java:221) at org.apache.poi.hssf.eventmodel.HSSFEventFactory.processEvents(HSSFEve ntFactory.java:139) at omvuk.util.EventExample.main(EventExample.java:93) Exception in thread "main" org.apache.poi.hssf.record.RecordFormatException: Una ble to construct record instance, the following exception occured: null at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.j ava:265) at org.apache.poi.hssf.eventmodel.HSSFEventFactory.genericProcessEvents( HSSFEventFactory.java:221) at org.apache.poi.hssf.eventmodel.HSSFEventFactory.processEvents(HSSFEve ntFactory.java:139) at omvuk.util.EventExample.main(EventExample.java:93)
Created attachment 3766 [details] Test workbook demonstrating error
Created attachment 4065 [details] This simple file replicates the problem. It appears to be due to the way in which strings are handled by StringPtg. The problem does not occur with SSTRecord (see next attachment).
Created attachment 4066 [details] This file does not have the problem even though it uses the same characters. LabelSSTRecord and SSTRecord appear to handle the character properly.
Works in CVS and possible 2.0pre3. Will be in the pre4 release. Added both problem files as testcases. See test14330 in TestBugs.java