GH-818: do not create bean symbols for annotation declarations

This commit is contained in:
Martin Lippert
2022-08-25 14:49:40 +02:00
parent e5b025ca79
commit bd34877b73
3 changed files with 46 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017, 2019 Pivotal, Inc.
* Copyright (c) 2017, 2022 Pivotal, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -165,4 +165,12 @@ public class SpringIndexerBeansTest {
);
}
@Test
public void testCustomAnnotationClass() throws Exception {
String docUri = directory.toPath().resolve("src/main/java/org/test/CustomAnnotation.java").toUri().toString();
SpringIndexerHarness.assertDocumentSymbols(indexer, docUri,
SpringIndexerHarness.symbol("@AliasFor(annotation = Component.class)", "@AliasFor(annotation=Component.class)")
);
}
}

View File

@@ -0,0 +1,21 @@
package org.test;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.core.annotation.AliasFor;
import org.springframework.stereotype.Component;
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Component
public @interface CustomAnnotation {
@AliasFor(annotation = Component.class)
String value() default "";
}