diff options
author | Bjørn Christian Seime <bjorncs@yahoo-inc.com> | 2017-07-13 16:55:00 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@yahoo-inc.com> | 2017-07-13 16:55:00 +0200 |
commit | ca1fefb2fcf5f1a97cb3efb278f762a28ebf9c40 (patch) | |
tree | 9b28192d169c25e57f1f342ac32b98bc56785df2 /application | |
parent | d319cf3f6310237e021b6d1f90d9e10c721b8f71 (diff) |
Remove dead Scala code
Diffstat (limited to 'application')
-rw-r--r-- | application/src/main/java/com/yahoo/application/container/JDisc.java | 26 | ||||
-rw-r--r-- | application/src/main/scala/com/yahoo/application/container/StackTrace.scala | 24 |
2 files changed, 10 insertions, 40 deletions
diff --git a/application/src/main/java/com/yahoo/application/container/JDisc.java b/application/src/main/java/com/yahoo/application/container/JDisc.java index 216fe6d809c..6cf98072232 100644 --- a/application/src/main/java/com/yahoo/application/container/JDisc.java +++ b/application/src/main/java/com/yahoo/application/container/JDisc.java @@ -6,14 +6,14 @@ import com.google.inject.AbstractModule; import com.google.inject.Module; import com.google.inject.name.Names; import com.yahoo.application.Networking; -import com.yahoo.component.AbstractComponent; -import com.yahoo.component.provider.ComponentRegistry; -import com.yahoo.config.model.ConfigModelRepo; -import com.yahoo.container.Container; import com.yahoo.application.container.handler.Request; import com.yahoo.application.container.handler.Response; import com.yahoo.application.container.impl.ClassLoaderOsgiFramework; import com.yahoo.application.container.impl.StandaloneContainerRunner; +import com.yahoo.component.AbstractComponent; +import com.yahoo.component.provider.ComponentRegistry; +import com.yahoo.config.model.ConfigModelRepo; +import com.yahoo.container.Container; import com.yahoo.container.standalone.StandaloneContainerApplication; import com.yahoo.container.standalone.StandaloneContainerApplication$; import com.yahoo.docproc.jdisc.DocumentProcessingHandler; @@ -23,7 +23,6 @@ import com.yahoo.jdisc.test.TestDriver; import com.yahoo.processing.handler.ProcessingHandler; import com.yahoo.search.handler.SearchHandler; -import java.io.File; import java.nio.file.Path; /** @@ -48,17 +47,12 @@ public final class JDisc implements AutoCloseable { private final boolean deletePathWhenClosing; private JDisc(Path path, boolean deletePathWhenClosing, Networking networking, ConfigModelRepo configModelRepo) { - try { - this.path = path; - this.deletePathWhenClosing = deletePathWhenClosing; - testDriver = TestDriver.newInstance(osgiFramework, "", false, //StandaloneContainerApplication.class, - bindings(path, configModelRepo, networking)); - - application = (StandaloneContainerApplication) testDriver.application(); - } catch (Throwable t) { - StackTrace.filterLogAndDieToJDiscInit(t); - throw t; - } + this.path = path; + this.deletePathWhenClosing = deletePathWhenClosing; + testDriver = TestDriver.newInstance(osgiFramework, "", false, //StandaloneContainerApplication.class, + bindings(path, configModelRepo, networking)); + + application = (StandaloneContainerApplication) testDriver.application(); } private Module bindings(final Path path, final ConfigModelRepo configModelRepo, final Networking networking) { diff --git a/application/src/main/scala/com/yahoo/application/container/StackTrace.scala b/application/src/main/scala/com/yahoo/application/container/StackTrace.scala deleted file mode 100644 index c66a9de4894..00000000000 --- a/application/src/main/scala/com/yahoo/application/container/StackTrace.scala +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.application.container - -/** - * @author tonytv - */ -object StackTrace { - private val jdiscContainerStartMarker = new StackTraceElement("============= JDiscContainer =============", "start", null, -1) - - def filterLogAndDieToJDiscInit(throwable: Throwable) { - val stackTrace = throwable.getStackTrace - - for { - top <- stackTrace.headOption - if !preserveStackTrace - if top.getClassName == classOf[com.yahoo.protect.Process].getName - index = stackTrace.lastIndexWhere(_.getClassName == classOf[JDisc].getName) - if (index != -1) - } throwable.setStackTrace(jdiscContainerStartMarker +: stackTrace.drop(index)) - } - - //TODO: combine with version in container/di - val preserveStackTrace: Boolean = Option(System.getProperty("jdisc.container.preserveStackTrace")).filterNot(_.isEmpty).isDefined -} |