To catch a situation I just had, I created a Collection as a local
variable, called one of it's mutators, but then did nothing with it when
I should have passed it into another method. But I had no warning that
what I'd done was useless.
So to formalize the request, is there any way to flag a Collection
constructed within a scope whose mutator interface methods are called
without the accessor interface methods being called (or vice versa)
within the scope of the variable? Obviously there should be no flag if
the Collection reference is passed out of the current scope by method
call or return value (or this should be configurable maybe) as I guess
it can only be assumed it is properly used by the caller/callee.
Hope this isn't sounding like a too specific case, just thought I'd
brain dump it in case there's something valuable in there; I think it's
a natural companion to the "field assigned but not accessed" warning.
I'm also thinking it applies equally to arrays too.