On Wed, 25 May 2022 17:07:36 GMT, Pavel Rappo <[email protected]> wrote:
>> Yes, same reasoning. `SnippetUtils` is broken if we get a null result. > >> `SnippetUtils` is broken if we get a null result. > > If it's unconditionally so, which it seems to be, wouldn't it be better to > throw something from `SnippetUtils.getSnippetById` instead? Hmmm, The current spec of `SnippetUtils` is to return `null` if an item cannot be found. So, it is only broken if the user really expects a non-null result. I guess it depends if there is enough use case where you might want a null result instead of an exception. ------------- PR: https://git.openjdk.java.net/jdk/pull/8796
