Bug 15102 - insufficient width in getRow() and getColumn() methods
Summary: insufficient width in getRow() and getColumn() methods
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 1.5.1
Hardware: PC Linux
: P3 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-05 10:06 UTC by Dale Harrison
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dale Harrison 2002-12-05 10:06:28 UTC
Subclasses of org.apache.poi.hssf.record.Record (NumberRecord, LSSTRecord, etc)
return a short for getRow() and getColumn(). Excel (2002) can handle 65535 rows.

D.
Comment 1 Andy Oliver 2003-07-24 14:00:55 UTC
wow...thats like....brief.  I totally don't understand it at all.
Comment 2 Dale Harrison 2003-07-25 01:59:47 UTC
Ok, i'll try again.

when dealing with large spreadsheets (> 32767 rows/columns) getRow() and 
getColumn() stop being useful after row/column 32767 as they return a short (-
2^15 -> 2^15-1), so the value wraps around. 32766, 32767, -32768, -32767, ...

It's an inconvenience having to check this and unsign the short manually.
Comment 3 Chris Nokleberg 2003-07-29 17:30:48 UTC
I agree this is a bug. It is not a good idea to use a short to represent an 
unsigned 16-bit value (which Java lacks). Explicit bounds checking should be 
done to enforce a range of values instead. There is also no performance benefit 
to using anything smaller than an int--at the JVM level it is actually more 
expensive to deal with shorts.
Comment 4 Jason Height 2004-10-14 03:40:31 UTC
Fixed in HEAD.