We’ve got nullability annotations now, so we should be defining them. For use 
cases like this, I’d examine how existing things work and then document the 
nullability as such. For new code, I prefer things to be non-null except for 
cases where it makes sense to use null rather than, say, passing Optional<T> 
parameters to methods or things like that.

> On Apr 12, 2024, at 08:55, Gary D. Gregory <ggreg...@apache.org> wrote:
> 
> Hi All,
> 
> Our current Javadoc says:
> 
>    /**
>     * Returns the content type output by this layout. The base class returns 
> "text/plain".
>     *
>     * @return the content type.
>     */
>    String getContentType();
> 
> I'd like to clarify if returning null should be legal/allowed for 
> implementation in general.
> 
> IOW, I'd like to say either:
> - Call sites should be expected to handle null, or
> - Implementations MUST not return null
> 
> WDYT?
> Gary

Reply via email to