Setting local reference variables to null
to "help the garbage collector" is unnecessary. It adds clutter to the code and can introduce subtle bugsmake maintenance difficult. Java just-in-time compilers (JITs) can perform an equivalent liveness analysis; in fact, most implementations do this. A related bad practice is use of a finalizer to null
out references. See MET12-J. Do not use finalizers for additional details.
...