I agree with you. I did not think of threads though using them nearly all the time :)
Assigning the getters/setters to the workbook looks very plausible.

Thanks Nick!


Zitat von Nick Burch <[EMAIL PROTECTED]>:

On Wed, 21 May 2008, Daniel Noll wrote:
But in my eyes having a (static) method called HSSFCell.setMissingCellPolicy(MissingCellPolicy policy) in addition to the normal HSSFCell getCell(short cellNum) would do a better job than the MissingCellPolicy being set everytime getCell is called. The standard MissingCellPolicy would be set to RETURN_NULL_AND_BLANK. Existing code could be edited with minimal effort using my suggestion.

Personally I dislike static methods. You never know when some other code running in the same JVM will set a value which you thought was untouchable.

I agree. I could well see the case where you have two servlets on a machine, one wanting one policy, one wanting another. POI needs to be thread safe, and I have previously rejected patches that broke this.

Alternatively there could be some way of setting it via the top-level workbook object (that way your workbook is isolated from one opened by someone else's code which has different requirements...) but I'm not sure how plausible that is.

HSSFRow has a reference to its parent HSSFWorkbook, so it should be fairly easy. We'd then have:
 row.getCell(num) - existing method, would now use policy off workbook
 row.getCell(num,Policy) - new method, uses specified policy
 workbook.getPolicy() - default workbook policy is as now (null & blanks)
 workbook.setPolicy(Policy) - sets a new policy, used by all calls after that

Does that look sensible to everyone?

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to