From bad739ae3be754bb495b5a3b5830a0c972f8fa39 Mon Sep 17 00:00:00 2001 From: Bjørn Christian Seime Date: Tue, 8 Feb 2022 16:03:06 +0100 Subject: Deprecate method leaking Guice --- jdisc_core/src/main/java/com/yahoo/jdisc/Container.java | 4 +++- jdisc_core/src/main/java/com/yahoo/jdisc/core/ContainerSnapshot.java | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'jdisc_core/src/main') diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/Container.java b/jdisc_core/src/main/java/com/yahoo/jdisc/Container.java index f3ed16c65e7..e96f7f08fe8 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/Container.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/Container.java @@ -49,8 +49,10 @@ public interface Container extends SharedResource, Timer { * @return The appropriate instance of the given class. * @throws ConfigurationException If this injector cannot find or create the provider. * @throws ProvisionException If there was a runtime failure while providing an instance. + * @deprecated Use {@link #getInstance(Class)} instead. */ - T getInstance(Key key); + @Deprecated(forRemoval = true, since = "7") // TODO Vespa 8 remove + default T getInstance(Key key) { throw new UnsupportedOperationException(); } /** * Returns the appropriate instance for the given injection type. When feasible, avoid using this method in diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/core/ContainerSnapshot.java b/jdisc_core/src/main/java/com/yahoo/jdisc/core/ContainerSnapshot.java index f3641f2475b..808c8e89b1b 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/core/ContainerSnapshot.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/core/ContainerSnapshot.java @@ -37,7 +37,10 @@ class ContainerSnapshot extends AbstractResource implements Container { this.containerReference = container.refer(context); } + /** @deprecated Use {@link #getInstance(Class)} instead. */ @Override + @Deprecated(forRemoval = true, since = "7") // TODO Vespa 8 remove + @SuppressWarnings("removal") public T getInstance(Key key) { return container.guiceInjector().getInstance(key); } -- cgit v1.2.3