summaryrefslogtreecommitdiffstats
path: root/standalone-container/src
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@yahoo-inc.com>2017-07-20 13:07:43 +0200
committerBjørn Christian Seime <bjorncs@yahoo-inc.com>2017-07-20 13:07:43 +0200
commitc9251da52d1b63f203e008ab7808c8123442bbaa (patch)
treed4bb3ae744d0e715f26049ed05402bd4d19069af /standalone-container/src
parent929a44e999bbaae9600753aea1a8335a9facd69e (diff)
Suppress deprecation warning. Enable warnings-as-errors
Diffstat (limited to 'standalone-container/src')
-rw-r--r--standalone-container/src/main/scala/com/yahoo/container/standalone/StandaloneContainerApplication.scala13
1 files changed, 11 insertions, 2 deletions
diff --git a/standalone-container/src/main/scala/com/yahoo/container/standalone/StandaloneContainerApplication.scala b/standalone-container/src/main/scala/com/yahoo/container/standalone/StandaloneContainerApplication.scala
index 14187afdaaa..1d4b83ce7d3 100644
--- a/standalone-container/src/main/scala/com/yahoo/container/standalone/StandaloneContainerApplication.scala
+++ b/standalone-container/src/main/scala/com/yahoo/container/standalone/StandaloneContainerApplication.scala
@@ -24,7 +24,7 @@ import com.yahoo.text.XML
import com.yahoo.vespa.defaults.Defaults
import com.yahoo.vespa.model.VespaModel
import com.yahoo.vespa.model.builder.xml.dom.VespaDomBuilder
-import com.yahoo.vespa.model.container.Container
+import com.yahoo.vespa.model.container.{Container, ContainerModel}
import com.yahoo.vespa.model.container.xml.ContainerModelBuilder.Networking
import com.yahoo.vespa.model.container.xml.{ConfigServerContainerModelBuilder, ContainerModelBuilder}
import org.w3c.dom.Element
@@ -180,7 +180,7 @@ object StandaloneContainerApplication {
val spec = containerRootElement(applicationPackage)
val containerModel = newContainerModelBuilder(networkingOption).build(deployState, configModelRepo, vespaRoot, spec)
containerModel.getCluster().prepare()
- containerModel.initialize(configModelRepo)
+ DeprecationSuppressor.initializeContainerModel(containerModel, configModelRepo)
val container = first(containerModel.getCluster().getContainers)
// TODO: If we can do the mutations below on the builder, we can separate out model finalization from the
@@ -227,4 +227,13 @@ object StandaloneContainerApplication {
}
def path(s: String) = FileSystems.getDefault.getPath(s)
+
+ // Ugly hack required since Scala cannot suppress warnings. https://issues.scala-lang.org/browse/SI-7934
+ private object DeprecationSuppressor extends DeprecationSuppressor
+ @deprecated("", "")
+ private class DeprecationSuppressor {
+ def initializeContainerModel(containerModel: ContainerModel, configModelRepo: ConfigModelRepo): Unit = {
+ containerModel.initialize(configModelRepo)
+ }
+ }
}