Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Reference nulling to "help the garbage collector" is not necessary at allunnecessary. In fact, it just adds clutter to the code and may introduce more subtle bugs. Assigning null to local variables is also not very useful as the Java Just-In-Time compiler (JIT) can equivalently do a liveness analysis. A related bad practice is to use a finalizer to null out references, thereby causing a huge performance hit.

...