poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Schwarze <...@admadic.de>
Subject Re: changed API when introducing ss to hssf, add old as @deprecated?
Date Fri, 18 Jul 2008 18:35:35 GMT
Nick Burch wrote:
> On Fri, 18 Jul 2008, Rainer Schwarze wrote:
>> I'm trying to work with JasperReports 3.0.0 which is built against 
>> POI-3.0.1-FINAL. When I use a newer POI library, it complains, because 
>> interfaces changed such as HSSFCell.setCellStyle(HSSFCellStyle) being 
>> now HSSFCell.setCellStyle(CellStyle).
> I'm guessing this is on the 3.5 / ooxml branch? 

I'm using an adjusted POI library, but the issue exists also with 
poi-3.5-beta1-20080718.jar .

 > HSSFCellStyle extends
> CellStyle, so you shouldn't see any difference - we've made the method 
> call more accepting, not less.

I get this when I use the 3.5 beta with JasperReports:

java.lang.NoSuchMethodError: org.apache.poi.hssf.usermodel.HSSFCell.setCellStyle(Lorg/apache/poi/hssf/usermodel/HSSFCellStyle;)V
    at net.sf.jasperreports.engine.export.JRXlsExporter.setCell(JRXlsExporter.java:208)
... (+ some more lines)

Since JasperReports is built against POI-3.0.1 and no rebuild of 
JasperReports should be necessary, binary compatibility is needed. 
Regarding such issues, I found this page quite handy in the past:


There is a section "Evolving API classes - API methods and constructors" 
which has a row containing:

"Change type of a formal parameter 	- 	Breaks compatibility"

I think this happens when the type of the cell style changes from 
HSSFCellStyle to CellStyle.

So to keep the binary compatibility the setCellStyle(HSSFCellStyle) 
should still be there, shouldn't it? Is binary compatibility

 > It's possible to compile almost all of the unit tests from poi 3.1
 > against the jar of poi 3.5, certainly all the cell style ones, so I'm
 > not sure why you're hitting a problem. (It's only MissingCellPolicy
 > and HSSFFormulaEvaluator.CellValue that need to change, see
 > docs/spreadsheet/converting.html)

If the code which uses HSSF doesn't know about XSSF and only deals with 
HSSF, should it still work with the 3.5 branch without modification / 

Best wishes, Rainer

To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org

View raw message