removed finalize() methods, deprecated

pull/533/head
Michael Christen 2 years ago
parent 3dfd7ba016
commit 8a06beaf24

@ -150,10 +150,6 @@ public class Handler implements IInArchive {
}
}
protected void finalize() throws Throwable {
close();
}
public void close() throws IOException {
if (_inStream != null) _inStream.close();
_inStream = null;

@ -155,11 +155,6 @@ public class EmbeddedSolrConnector extends SolrServerConnector implements SolrCo
return this.core == null || this.core.isClosed();
}
@Override
protected void finalize() throws Throwable {
this.close();
}
@Override
public synchronized void close() {
if (this.core != null && !this.core.isClosed()) try {this.commit(false);} catch (final Throwable e) {ConcurrentLog.logException(e);}

@ -235,11 +235,6 @@ public class EmbeddedInstance implements SolrInstance {
return c;
}
@Override
protected void finalize() throws Throwable {
this.close();
}
@Override
public synchronized void close() {
for (final SolrCore core: this.cores.values()) core.close();

@ -127,14 +127,6 @@ public class NoticedURL {
}
}
@Override
protected void finalize() throws Throwable {
if ((this.coreStack != null) || (this.limitStack != null) || (this.remoteStack != null)) {
ConcurrentLog.warn("plasmaCrawlNURL", "NURL stack closed by finalizer");
this.close();
}
}
public int size() {
return ((this.coreStack == null) ? 0 : this.coreStack.size()) + ((this.limitStack == null) ? 0 : this.limitStack.size()) + ((this.remoteStack == null) ? 0 : this.remoteStack.size());
}

@ -92,11 +92,6 @@ public class ImportDump {
if (statement != null) try {statement.close();} catch (final SQLException e) {}
}
}
@Override
protected void finalize() throws Throwable {
close();
}
public synchronized void close() {
this.conn.close();

@ -67,11 +67,6 @@ public class PhpBB3Dao implements Dao {
this.users = new HashMap<Integer, String>();
}
@Override
protected void finalize() throws Throwable {
close();
}
@Override
public Date first() {
Statement stmt = null;

@ -172,10 +172,6 @@ public class ContentScraper extends AbstractScraper implements Scraper {
this.content = null;
}
@Override
public void finalize() {
this.close();
}
@Override
public String toString() {
return "<" + name + " " + opts + ">" + content + "</" + name + ">";
}

@ -311,11 +311,6 @@ public final class Heap extends HeapModifier implements BLOB {
this.close(true);
}
@Override
public void finalize() {
this.close();
}
public int getBuffermax() {
return this.buffermax;
}

@ -87,11 +87,6 @@ public class HeapModifier extends HeapReader implements BLOB {
close(true);
}
@Override
public void finalize() {
this.close();
}
/**
* remove a BLOB
* @param key the primary key

@ -664,11 +664,6 @@ public class HeapReader {
close(true);
}
@Override
public void finalize() {
this.close();
}
/**
* ask for the length of the primary key
* @return the length of the key

@ -466,11 +466,6 @@ public class MapHeap implements Map<byte[], Map<String, String>> {
if (this.blob != null) this.blob.close(true);
}
@Override
public void finalize() {
close();
}
protected class FullMapIterator extends LookAheadIterator<Map.Entry<byte[], Map<String, String>>> implements Iterator<Map.Entry<byte[], Map<String, String>>> {
// enumerates Map-Type elements
// the key is also included in every map that is returned; it's key is 'key'

@ -253,9 +253,4 @@ public class Stack {
public synchronized void close() {
this.stack.close(true);
}
@Override
public void finalize() {
this.close();
}
}

@ -261,9 +261,4 @@ public class Stacks {
se.stack.close();
}
}
@Override
public void finalize() {
this.close();
}
}

@ -93,11 +93,6 @@ public final class BufferedRecords {
if (this.efs != null) this.efs.close();
}
@Override
protected final synchronized void finalize() {
if (this.efs != null) close();
}
public final void get(final long index, final byte[] b, final int start) throws IOException {
final Long idx = Long.valueOf(index);
final byte[] bb;

@ -89,9 +89,4 @@ public final class CachedFileReader extends AbstractReader implements Reader {
this.cache = null;
}
@Override
protected void finalize() throws Throwable {
this.close();
}
}

@ -170,9 +170,4 @@ public final class CachedFileWriter extends AbstractWriter implements Writer {
this.cachelen = 0;
}
@Override
protected final void finalize() throws Throwable {
this.close();
}
}

@ -144,11 +144,6 @@ public final class RandomAccessIO {
if (this.ra != null) this.ra.close();
}
@Override
protected final void finalize() throws Throwable {
if (this.ra != null) this.close();
}
public final void deleteOnExit() {
this.ra.deleteOnExit();
}

@ -593,11 +593,6 @@ public class Table implements Index, Iterable<Row.Entry> {
if (tablefile != null) tableTracker.remove(tablefile);
}
@Override
protected void finalize() {
if (this.file != null) close();
}
@Override
public String filename() {
return this.file.filename().toString();

@ -129,11 +129,6 @@ public class NewsDB {
this.news = null;
}
@Override
protected void finalize() {
close();
}
public int size() {
return this.news.size();
}

@ -103,11 +103,6 @@ public class NewsQueue implements Iterable<NewsDB.Record> {
this.queueStack = null;
}
@Override
protected void finalize() {
close();
}
public int size() {
return this.queueStack.size();
}

Loading…
Cancel
Save