https://issues.apache.org/bugzilla/show_bug.cgi?id=44695
Summary: HSSF: Formulas are broken after re-save
Product: POI
Version: unspecified
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: HSSF
AssignedTo: [email protected]
ReportedBy: [EMAIL PROTECTED]
Actually there are two problems:
(1) In some cases formulas are broken after save.
(2) POI can't read the saved file with the broken formulas. I'm getting the
following exception:
Exception in thread "main" org.apache.poi.hssf.record.RecordFormatException:
Unable to construct record instance
at
org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:204)
at
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:122)
at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:204)
at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:256)
at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:237)
at org.apache.poi.hssf.scratchpad.Scratchpad.main(Scratchpad.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at
org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:192)
... 10 more
Caused by: java.lang.IllegalArgumentException: Illegal length 17478
at
org.apache.poi.hssf.record.RecordInputStream.readCompressedUnicode(RecordInputStream.java:270)
at
org.apache.poi.hssf.record.ExternalNameRecord.fillFields(ExternalNameRecord.java:162)
at org.apache.poi.hssf.record.Record.<init>(Record.java:55)
at
org.apache.poi.hssf.record.ExternalNameRecord.<init>(ExternalNameRecord.java:54)
... 15 more
This bug has appeared recently. The attached unit test passes with POI 3.0.2
but fails with trunk.
I attached a failing unit test and two files:
formulas.xls initial file with a formula in A1
formulas-saved.xls saved by POI. The formula in A1 is broken
It seems to be related to bug #44504. Josh, any ideas?
Regards,
Yegor
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]