Do you always assign null to an object after its scope has been reached?
Or do you rely on the JVM for garbage collection?
The one time I tend to use this practice is if I need to transform a large Collection in some early part of a method.
For example:
public void foo() {
List extends Trade> trades = loadTrades();
Map> tradesByDate = groupTradesByDate(trades);
trades = null; // trades no longer required.
// Apply business logic to tradesByDate map.
}
Obviously I could reduce the need for this by refactoring this into another method: Map so it really depends on circumstances / clarity of code.