News for hackers. Stuff that matters.
Re:Deprecating: java.util.Optional.get()? by masklinn on Thursday April 28, 2016 @11:03AM (#11589365)
> You should never have concrete expectations or make assertions on an unknown

As long as Optional#isPresent exists, you can have "concrete expectations" of an optional's content (or lack thereof).

> At that point a harmless looking refactor by someone else can introduce NPEs.

The fundamental problem is not .get, it's that you're qualifying code changes involving partial function as "harmless-looking" and "refactoring"

There are no comments on this comment yet.