poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 47339] New: Unexpected base token id (24)
Date Tue, 09 Jun 2009 20:14:13 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=47339

           Summary: Unexpected base token id (24)
           Product: POI
           Version: 3.2-FINAL
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: robert.kish@ncogroup.com


I'm working on a project to extract the content of XLS into useable text files.
I'm trying to get an understanding of how data types can be used. I created an
XLS document with a formula "=a+B". This is invalid. I wanted to see how POI
would handle it. It didn't handle it very well. In Excel CSV output, it would
produce "#VALUE!". POI generates an exception which is listed below.

org.apache.poi.hssf.record.formula.Ptg, method createBasePtg, does not handle
value 24 (0x18). While reviewing the source, I don't see it handle value 0x1b
either.

However, the code in createPtg method says "if (id < 0x20) {", then call
createBasePtg.

The source in 3.5 is the same as 3.2.

Unfortunately, I don't have a patch or a fix for this issue, as I don't fully
understand the correct action that should be taken.

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:186)
    at
org.apache.poi.hssf.eventusermodel.HSSFRecordStream.getNextRecord(HSSFRecordStream.java:162)
    at
org.apache.poi.hssf.eventusermodel.HSSFRecordStream.nextRecord(HSSFRecordStream.java:93)
    at
org.apache.poi.hssf.eventusermodel.HSSFEventFactory.genericProcessEvents(HSSFEventFactory.java:141)
    at
org.apache.poi.hssf.eventusermodel.HSSFEventFactory.processEvents(HSSFEventFactory.java:98)
    at
org.apache.poi.hssf.eventusermodel.HSSFEventFactory.processWorkbookEvents(HSSFEventFactory.java:63)
...
Caused by: java.lang.RuntimeException: Unexpected base token id (24)
    at org.apache.poi.hssf.record.formula.Ptg.createBasePtg(Ptg.java:161)
    at org.apache.poi.hssf.record.formula.Ptg.createPtg(Ptg.java:82)
    at org.apache.poi.hssf.record.formula.Ptg.readTokens(Ptg.java:54)
    at org.apache.poi.hssf.record.FormulaRecord.<init>(FormulaRecord.java:202)
    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:513)
    at
org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:184)
    ... 7 more

-- 
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message