mirror of https://github.com/apache/lucene.git
SOLR-924: Code cleanup: make all existing finalize() methods call super.finalize() in a finally block
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@728336 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
fc3eed423b
commit
c7b3ca5d16
|
@ -223,6 +223,10 @@ Other Changes
|
|||
10. SOLR-900: Moved solrj into /src/solrj. The contents of solr-common.jar is now included
|
||||
in the solr-solrj.jar. (ryan)
|
||||
|
||||
11. SOLR-924: Code cleanup: make all existing finalize() methods call
|
||||
super.finalize() in a finally block. All current instances extend
|
||||
Object, so this doesn't fix any bugs, but helps protect against
|
||||
future changes. (Kay Kay via hossman)
|
||||
|
||||
Build
|
||||
----------------------
|
||||
|
|
|
@ -335,10 +335,11 @@ public class JdbcDataSource extends
|
|||
}
|
||||
}
|
||||
|
||||
protected void finalize() {
|
||||
protected void finalize() throws Throwable {
|
||||
try {
|
||||
conn.close();
|
||||
} catch (Exception e) {
|
||||
} finally {
|
||||
super.finalize();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -530,6 +530,10 @@ public class ConcurrentLRUCache<K,V> {
|
|||
}
|
||||
|
||||
protected void finalize() throws Throwable {
|
||||
destroy();
|
||||
try {
|
||||
destroy();
|
||||
} finally {
|
||||
super.finalize();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -261,8 +261,12 @@ public class CoreContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void finalize() {
|
||||
shutdown();
|
||||
protected void finalize() throws Throwable {
|
||||
try {
|
||||
shutdown();
|
||||
} finally {
|
||||
super.finalize();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -741,9 +741,14 @@ public final class SolrCore implements SolrInfoMBean {
|
|||
return refCount.get() <= 0;
|
||||
}
|
||||
|
||||
protected void finalize() {
|
||||
if (getOpenCount() != 0) {
|
||||
log.error("REFCOUNT ERROR: unreferenced " + this + " (" + getName() + ") has a reference count of " + getOpenCount());
|
||||
protected void finalize() throws Throwable {
|
||||
try {
|
||||
if (getOpenCount() != 0) {
|
||||
log.error("REFCOUNT ERROR: unreferenced " + this + " (" + getName()
|
||||
+ ") has a reference count of " + getOpenCount());
|
||||
}
|
||||
} finally {
|
||||
super.finalize();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -198,11 +198,13 @@ public class SolrIndexWriter extends IndexWriter {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void finalize() {
|
||||
protected void finalize() throws Throwable {
|
||||
try {
|
||||
super.close();
|
||||
} catch (IOException e) {
|
||||
} finally {
|
||||
super.finalize();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue