[Inspection Gadgets 0.0.9] Return of Collections or array field

Hi Dave,

I found that this inspection is complaining about return of Collections.EMPTY_?????.

How about not doing so, as they are unmodifiable by default?


Comment actions Permalink

Good call. I'll put it on the TODO list.


Comment actions Permalink

This particular inspection also doesn't understand a related pattern I frequently use:

(No, this pattern isn't perfect, but it's generally good enough.) I'm not sure exactly how the inspection could be changed to not warn me in this case, but if it's simple enough and correct enough, it'd be useful.

Of course, I could simply change my pattern to create a new unmodifiableList on each call to getThings() with minimal impact, too...


Please sign in to leave a comment.