Why is this an issue?
There is no point in setting class fields to null
in a finalizer. If this this is a hint to the garbage collector, it is unnecessary -
the object will be garbage collected anyway - and doing so may actually cause extra work for the garbage collector.
Noncompliant code example
public class Foo {
private String name;
@Override
void finalize() {
name = null; // Noncompliant; completely unnecessary
}
}