Skip to content

Commit 7e565a9

Browse files
committed
do not include method level annotations in injection point metadata for bean methods
1 parent 67335fc commit 7e565a9

File tree

1 file changed

+7
-2
lines changed
  • headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils

1 file changed

+7
-2
lines changed

headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/ASTUtils.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
package org.springframework.ide.vscode.boot.java.utils;
1212

1313
import java.util.ArrayList;
14-
import java.util.Arrays;
1514
import java.util.Collection;
1615
import java.util.LinkedHashMap;
1716
import java.util.List;
@@ -485,7 +484,13 @@ public static void findInjectionPoints(MethodDeclaration method, TextDocument do
485484
Location location = new Location(doc.getUri(), range);
486485

487486
List<Annotation> allAnnotations = new ArrayList<>();
488-
allAnnotations.addAll(annotationsOnMethod);
487+
488+
// add method level annotations to each injection point only for autowired setter injection
489+
// (not for bean methods)
490+
if (checkForAnnotation) {
491+
allAnnotations.addAll(annotationsOnMethod);
492+
}
493+
489494
allAnnotations.addAll(getAnnotations(variable));
490495

491496
AnnotationMetadata[] annotations = getAnnotationsMetadata(allAnnotations, doc);

0 commit comments

Comments
 (0)