diff options
author | Bjørn Christian Seime <bjorncs@yahoo-inc.com> | 2017-06-12 11:36:18 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@yahoo-inc.com> | 2017-06-12 11:42:38 +0200 |
commit | 6d9089f9788e9dd3e975dee2bd02580f7ed4c88e (patch) | |
tree | e9e0c8809095c54c7257e4d9c6d988258b84b7a4 /jdisc_core/src/main/java/com/yahoo/jdisc/core/ActiveContainer.java | |
parent | 3c4d24437dbbc120d9ee9c9642600024125a649e (diff) |
Remove finalizer in ActiveContainer
No instances of the log message has been detected the last month, which
indicates that the finalizer is not necessary.
Diffstat (limited to 'jdisc_core/src/main/java/com/yahoo/jdisc/core/ActiveContainer.java')
-rw-r--r-- | jdisc_core/src/main/java/com/yahoo/jdisc/core/ActiveContainer.java | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/core/ActiveContainer.java b/jdisc_core/src/main/java/com/yahoo/jdisc/core/ActiveContainer.java index 51a84a4a6c6..fbc45f000d2 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/core/ActiveContainer.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/core/ActiveContainer.java @@ -17,15 +17,12 @@ import com.yahoo.jdisc.service.ServerProvider; import java.net.URI; import java.util.Map; -import java.util.logging.Logger; /** * @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen</a> */ public class ActiveContainer extends AbstractResource implements CurrentContainer { - private static final Logger log = Logger.getLogger(ActiveContainer.class.getName()); - private final ContainerTermination termination; private final Injector guiceInjector; private final Iterable<ServerProvider> serverProviders; @@ -67,22 +64,6 @@ public class ActiveContainer extends AbstractResource implements CurrentContaine termination.run(); } - // TODO Get rid of finalizer and use PhantomReference or Java 9 Cleaner instead - @Override - protected void finalize() throws Throwable { - try { - int retainCount = retainCount(); - if (retainCount > 0) { - log.severe("Destructing " + this + " through finalizer since reference count never reached zero. " + - "This is an indication of either a resource leak or invalid use of reference counting. " + - "Retained references as this moment: " + retainCount); - destroy(); - } - } finally { - super.finalize(); - } - } - /** * Make this instance retain a reference to the resource until it is destroyed. */ |