fix index supertype information for spring data repository beans
This commit is contained in:
@@ -66,10 +66,12 @@ public class DataRepositorySymbolProvider extends AbstractSymbolProvider {
|
||||
|
||||
InjectionPoint[] injectionPoints = ASTUtils.findInjectionPoints(typeDeclaration, doc);
|
||||
|
||||
Set<String> supertypes = new HashSet<>();
|
||||
ASTUtils.findSupertypes(beanType, supertypes);
|
||||
ITypeBinding concreteBeanTypeBindung = typeDeclaration.resolveBinding();
|
||||
|
||||
String concreteRepoType = typeDeclaration.resolveBinding().getQualifiedName();
|
||||
Set<String> supertypes = new HashSet<>();
|
||||
ASTUtils.findSupertypes(concreteBeanTypeBindung, supertypes);
|
||||
|
||||
String concreteRepoType = concreteBeanTypeBindung.getQualifiedName();
|
||||
Bean beanDefinition = new Bean(beanName, concreteRepoType, location, injectionPoints, (String[]) supertypes.toArray(new String[supertypes.size()]));
|
||||
|
||||
context.getGeneratedSymbols().add(new CachedSymbol(context.getDocURI(), context.getLastModified(), enhancedSymbol, beanDefinition));
|
||||
|
||||
@@ -210,6 +210,9 @@ public class SpringMetamodelIndexerBeansTest {
|
||||
assertEquals(1, beans.length);
|
||||
assertEquals("customerRepository", beans[0].getName());
|
||||
assertEquals("org.test.springdata.CustomerRepository", beans[0].getType());
|
||||
|
||||
assertTrue(beans[0].isTypeCompatibleWith("org.test.springdata.CustomerRepository"));
|
||||
assertTrue(beans[0].isTypeCompatibleWith("org.springframework.data.repository.CrudRepository"));
|
||||
|
||||
InjectionPoint[] injectionPoints = beans[0].getInjectionPoints();
|
||||
assertEquals(0, injectionPoints.length);
|
||||
|
||||
Reference in New Issue
Block a user