https://issues.apache.org/bugzilla/show_bug.cgi?id=44967

           Summary: Exception when reading SharedFormulaRecord
           Product: POI
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


I was going to research bug #44010 and found that POI can't anymore read the
problem file:


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:208)
        at
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:126)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:245)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:168)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:297)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:278)
        at org.apache.poi.hssf.scratchpad.ReWrite.main(ReWrite.java:42)
        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:196)
        ... 11 more
Caused by: java.lang.IllegalArgumentException: Unexpected operand type code '?'
(65533)
        at
org.apache.poi.hssf.record.formula.function.FunctionMetadataReader.parseOperandTypeCode(FunctionMetadataReader.java:162)
        at
org.apache.poi.hssf.record.formula.function.FunctionMetadataReader.parseOperandTypeCodes(FunctionMetadataReader.java:138)
        at
org.apache.poi.hssf.record.formula.function.FunctionMetadataReader.processLine(FunctionMetadataReader.java:103)
        at
org.apache.poi.hssf.record.formula.function.FunctionMetadataReader.createRegistry(FunctionMetadataReader.java:82)
        at
org.apache.poi.hssf.record.formula.function.FunctionMetadataRegistry.getInstance(FunctionMetadataRegistry.java:41)
        at
org.apache.poi.hssf.record.formula.function.FunctionMetadataRegistry.getFunctionByIndex(FunctionMetadataRegistry.java:57)
        at org.apache.poi.hssf.record.formula.FuncPtg.<init>(FuncPtg.java:42)
        at org.apache.poi.hssf.record.formula.Ptg.createPtg(Ptg.java:250)
        at
org.apache.poi.hssf.record.SharedFormulaRecord.getParsedExpressionTokens(SharedFormulaRecord.java:168)
        at
org.apache.poi.hssf.record.SharedFormulaRecord.fillFields(SharedFormulaRecord.java:160)
        at org.apache.poi.hssf.record.Record.<init>(Record.java:55)
        at
org.apache.poi.hssf.record.SharedFormulaRecord.<init>(SharedFormulaRecord.java:56)


There are 3 SharedFormula records and all of them fail. I extracted the record
data and attached a failing unit test.

Josh, can you look into it? It might be related to your recent changes. 


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]

Reply via email to