reef-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Weimer <mar...@weimo.de>
Subject Re: Is it a good idea for toString() to return null?
Date Thu, 31 Dec 2015 06:27:02 GMT
> I've found a bunch of classes in
> org.apache.reef.runtime.hdinsight.client.yarnrest with toString()
> methods which can return null. [...] Is it a good idea?

No, returning `null` is never a good idea. We generally use
`Optional<T>` on the java side to indicate when a method might return
nothing.

I believe I wrote that code, and in great hurry when we prepared for
the classes at the machine learning summer school. Sorry about that!

Markus

Mime
View raw message