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 44921] Coding Error: This method should never be called. This ptg should be converted
Date Fri, 02 May 2008 22:35:55 GMT

Josh Micich <josh@gildedtree.com> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #5 from Josh Micich <josh@gildedtree.com>  2008-05-02 15:35:54 PST ---
Fix applied in svn r652934

The fix involves allowing all relative ref Ptgs (RefN*.java and AreaN*.java) to
be written out (/serialized).

This bug was probably not visible before, because conditional formats and data
validation are recent additions to POI.  These use relative-reference Ptgs
(similar to those of shared formulas).  In earlier versions of POI a strategy
was adopted to convert these Ptgs to absolute references (I assume) to make the
formula evaluation stuff easier.  Hence relative reference Ptgs were never
expected to be serialized.  For the new conditional format and data validation
stuff, the conversion does not take place (and probably shouldn't) so that's
why the error occurred.

Seems like Andy hit a very similar problem before (see svn r513604).  I can't
find a bugzilla record though. 

There are significant problems with how relative references are handled by POI
(see bug 44636).  This bug was also fixed with a small change, but a more
correct solution will probably involve skipping the shared formula conversion

For interest, here are the two stack trace fragments showing how the
conditional format and data validation stuff is relevant to this bug:

RefNVPtg.writeBytes(byte[], int) line: 51       
Ptg.serializePtgStack(Stack, byte[], int) line: 394     
CFRuleRecord.serialize(int, byte[]) line: 567   
CFRecordsAggregate.serialize(int, byte[]) line: 168     
Sheet.serialize(int, byte[]) line: 830  

RefNVPtg.writeBytes(byte[], int) line: 51       
DVRecord.serialize(int, byte[]) line: 462       
Sheet.serialize(int, byte[]) line: 830  

BTW - when supplying sample code, please try to use plain java (1.4 or 1.5). 
Also try to cut out as much unneeded stuff as possible.  This bug can actually
be re-produced with the following code:

HSSFWorkbook wb = new HSSFWorkbook(new FileInputStream("ex44921-21902.xls"));
ByteArrayOutputStream baos = new ByteArrayOutputStream();

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

View raw message