summaryrefslogtreecommitdiffstats
path: root/container-core
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@verizonmedia.com>2021-12-15 13:59:08 +0100
committerBjørn Christian Seime <bjorncs@verizonmedia.com>2021-12-15 15:33:09 +0100
commit3741913435c48b3302684edb2d1eaeefdee1e7c8 (patch)
tree150b3df494d9852eb785c8c79d4b4bfad59bc51f /container-core
parentcf9778567ea10deab92bd1a1743b80980f68e7fd (diff)
Add custom Inject annotation so Guice is not needed just for the annotation
Diffstat (limited to 'container-core')
-rw-r--r--container-core/src/main/java/com/yahoo/container/di/componentgraph/core/ComponentNode.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/container-core/src/main/java/com/yahoo/container/di/componentgraph/core/ComponentNode.java b/container-core/src/main/java/com/yahoo/container/di/componentgraph/core/ComponentNode.java
index bf7366cc60f..e5a66fea8d1 100644
--- a/container-core/src/main/java/com/yahoo/container/di/componentgraph/core/ComponentNode.java
+++ b/container-core/src/main/java/com/yahoo/container/di/componentgraph/core/ComponentNode.java
@@ -1,7 +1,6 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.container.di.componentgraph.core;
-import com.google.inject.Inject;
import com.google.inject.Key;
import com.yahoo.collections.Pair;
import com.yahoo.component.AbstractComponent;
@@ -280,7 +279,8 @@ public class ComponentNode extends Node {
Constructor<?> annotated = null;
for (Constructor<?> ctor : publicConstructors) {
- Annotation annotation = ctor.getAnnotation(Inject.class);
+ Annotation annotation = ctor.getAnnotation(com.google.inject.Inject.class);
+ if (annotation == null) annotation = ctor.getAnnotation(com.yahoo.component.annotation.Inject.class);
if (annotation != null) {
if (annotated == null) {
annotated = ctor;