RFR(m): 8140281 deprecate Optional.get()
aph at redhat.com
Wed Apr 27 16:58:27 UTC 2016
On 04/27/2016 04:44 PM, Stephen Colebourne wrote:
> Better suppress warnings would be nice, and the problem statement
> below is reasonable, what concerns me more is the impact on clients
> of the Strata API. Strata uses Optional heavily - we have "done the
> right thing" and do not return null from any public methods. As
> such, a *lot* of methods return Optional. If this change happens,
> then everyone who adopts Strata today and codes against our API
> (legitimately using isPresent() followed by get() ) will suffer when
> Java 9 is released. I don't see how a better SuppressWarnings helps
> those clients.
Sure, but almost all of the uses of Optional.get() will be in the future.
This rather reminds me of the early UNIX bug report about make syntax.
The bug was that make(1) treated tab characters and spaces
differently. This bug could have been fixed but there were about 20
users of make already, and they would have had to change their
makefiles. And probably everyone reading this mail has suffered
because of that bug.
More information about the core-libs-dev