Bug 51456 - POI web documentation ambiguity
Summary: POI web documentation ambiguity
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: unspecified
Hardware: All Windows CE
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-30 20:18 UTC by Dennis Sheil
Modified: 2011-07-01 11:44 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Sheil 2011-06-30 20:18:25 UTC
In the documentation for POI text extraction -

http://poi.apache.org/spreadsheet/quick-guide.html#TextExtraction

One of the lines of code is:

CellReference cellRef = new CellReference(row.getRowNum(), cell.getCellNum());

This assumes the Cell class has a getCellNum() method call.  But only one implementing class for cell uses a getCellNum() method - HSSFCell.  Neither XSSFCell nor SXSSFCell do.

As that documentation page is a "Busy Developers' Guide" for those who "want to use HSSF and XSSF read and write spreadsheets in a hurry", I think that the manner in which it currently is displayed has to be changed in some fashion.  Either it should be noted this will only extract text for HSSF, or the code should handle both HSSF and XSSF, or two code examples, one for each case should be there.  As it currently stands, it only serves to confuse those looking at it, especially if they're having other unrelated problems with POI.  There are a number of options for how it can be changed, but any one of those options would be better than the confusing example which exists now.
Comment 1 Yegor Kozlov 2011-07-01 11:44:29 UTC
Fixed in r1141906

The correct method is getColumnIndex().

Yegor