Bug 12659 - Problem with documents with many text pieces
Summary: Problem with documents with many text pieces
Alias: None
Product: POI
Classification: Unclassified
Component: HDF (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2002-09-15 11:31 UTC by Staffan Friberg
Modified: 2004-11-16 19:05 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Staffan Friberg 2002-09-15 11:31:59 UTC
When trying to parse a document with more then one text pieces, for example the 
text encoding is different for different parts in the text, only the first piece 
is stored in the BTreeSet. After some digging I saw that TextPiece.compare 
always returned 0 which cause the BTree to think that it was the same piece 
again. A simple change would be to call the super.compare method in 

Comment 1 Andy Oliver 2002-09-15 20:19:08 UTC
can you submit a patch?  http://jakarta.apache.org/poi/getinvolved/index.html

It would be easier that way.
Comment 2 Staffan Friberg 2002-09-16 16:48:53 UTC
Here is a patch, hope it works.  //staffan

Index: TextPiece.java
RCS file: 
retrieving revision 1.1
diff -r1.1 TextPiece.java
<        return 0;
>       return super.compareTo(obj);

Comment 3 Avik Sengupta 2003-02-03 15:21:38 UTC
Anybody have a unit test for this? dont want to mess the code without one. 
Comment 4 Andy Oliver 2003-02-04 02:09:07 UTC
agreed.  Also follow the directions on "getinvolved"  Patches pasted are patches
wasted (and wrapped)
Comment 5 Andy Oliver 2003-07-24 13:24:39 UTC
see HWPF..