Thanks for the prompt feedback.
Question: Why would we need to depreciate setValue(double value)
instead of replacing it immediately with setValue(Double value)?
As far as I understand, the JVM boxes/unboxes the primitives
automatically?
Of course, if this change was not welcome, I would need to implement
helper methods by myself. But maybe 1000 other users right now write
exactly the same helper methods within their own projects?
Long story short: please discuss it internally and hand a final
decision. If a PR was welcome I would provide it, otherwise I would
fall back to my own helper methods.
Again, thank you for your time and advise.
Cheers
Andreas
On Tue, 2021-12-14 at 09:09 +0000, PJ Fanning wrote:
> Hi Andreas,
> We can't remove APIs without deprecating them for a release cycle
> first.
>
> So the only solution is the add more API methods.
>
> If we add a new setDoubleObject method, we would need to add
> setBooleanObject, etc to keep the API consistent.
>
> I would not favour the change you are proposing generally. While the
> API is not to your liking, adding a whole extra set of null friendly
> sets (and possibly gets) would make the API even larger and for me,
> the benefit is not great enough. Other devs might have different
> opinions on this.
>
> Developers can also add their own helper methods to do this sort of
> thing.
>
>
> public static void setCellValue(Cell c, Double d) {
> if (d == null) {
> cell.setBlank();
> } else {
> cell.setValue(d);
> }
> }
>
>
>
>
>
>
> On Tuesday 14 December 2021, 08:19:07 GMT+1, Andreas Reichel
> <[email protected]> wrote:
>
>
>
>
>
> Compliments of the season,
>
> please allow me to ask: why exactly does the Cell interface define
>
> setValue(double value)
>
> instead of
>
> setValue(Double value)
>
> which would allow for setting NULL values?
>
> I understand, that I am supposed to use setBlank() instead but when
> you
> create very large Excel file pragmatically, then it is very
> cumbersome
> to check every single Value for NULL first in order to setValue() or
> setBlank().
> Was there a chance to change/amend setValue() to use Objects instead
> of
> primitives only? (I would volunteer with a PR of course).
>
> Warm regards
> Andreas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>