Re: extending APIs to offer alternatives where existing APIs can return null

2021-05-28 Thread Andreas Beeker
I'm -1 on this - maybe I've voted differently before, but the more I see the optional tries in the POI API, the more I dislike them. I thought about going through the lists ([1]/[2]) and give my two pence here, but basically there are very rare cases where I think, oh cool it's an Optional ret

extending APIs to offer alternatives where existing APIs can return null

2021-05-28 Thread fannin...@apache.org
An example is spreadsheet Workbook#getSheet(String name) -- which returns null if no sheet is found. We could add a method Workbook#getOptionalSheet(String name) -- which returns an instance of java.util.Optional. Is this work worthwhile? I can probably add a few methods like this but probably