示例
public
class
ClassA {
protected void
finalize()
throws
Throwable {
super
.finalize();
//...
}
public
void
methodA {
try
{
finalize();
//...
}
catch
( Throwable t ) {
//...
}
}
}
解决方案
除去 finalize() 方法调用。
public
class
ClassA {
protected void
finalize()
throws
Throwable {
super
.finalize();
//...
}
public
void
methodA {
//...
}
}