diff options
author | Bjørn Christian Seime <bjorncs@yahoo-inc.com> | 2017-07-20 13:07:43 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@yahoo-inc.com> | 2017-07-20 13:07:43 +0200 |
commit | c9251da52d1b63f203e008ab7808c8123442bbaa (patch) | |
tree | d4bb3ae744d0e715f26049ed05402bd4d19069af /standalone-container | |
parent | 929a44e999bbaae9600753aea1a8335a9facd69e (diff) |
Suppress deprecation warning. Enable warnings-as-errors
Diffstat (limited to 'standalone-container')
-rw-r--r-- | standalone-container/pom.xml | 7 | ||||
-rw-r--r-- | standalone-container/src/main/scala/com/yahoo/container/standalone/StandaloneContainerApplication.scala | 13 |
2 files changed, 11 insertions, 9 deletions
diff --git a/standalone-container/pom.xml b/standalone-container/pom.xml index 6e29d7fcc7c..85a401d6af3 100644 --- a/standalone-container/pom.xml +++ b/standalone-container/pom.xml @@ -99,13 +99,6 @@ <plugin> <groupId>net.alchim31.maven</groupId> <artifactId>scala-maven-plugin</artifactId> - <configuration> - <args> - <arg>-unchecked</arg> - <arg>-feature</arg> - <arg>-deprecation</arg> - </args> - </configuration> <executions> <execution> <id>compile</id> 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) + } + } } |