DonalEvans commented on pull request #5969:
URL: https://github.com/apache/geode/pull/5969#issuecomment-769301760
> This fixes the problem but I'm wondering if the code would be cleaner if
you did just one null check on _list_ like
>
> > if (list == null) {
> > list = Collections.emptyList();
> > }
>
> Then you could get rid of the rest of the null checks.
I took a slightly different approach to the one suggested, since if `peek()`
throws an exception, it would still have been possible for `list` to be null in
the last two places it was used. Instantiating `list` at the time of
declaration and then using `addAll()` prevents it from ever being null.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]