Datatable not correct for find spring components?
Not sure if this is a bug or expected behaviour.
when we run find spring components recipe, we get the results back of all @Bean annotated methods. However, some/all these beans that are marked with @bean are not added to the datatables of the results it seems.
Classes with @Component or extensions are shown correctly it seems.
- Using a codebase without classes marked with
@Component - Running the recipe
org.openrewrite.java.spring.search.FindSpringComponents - See there are results
-
See details of results
-
See that only one of the datables is available (as no bean's through component annotation?)
-
The available datatable contains the correct rows
EXPECTED: Also the other table should contain the beans identified.
Here only the addition to one of the 2 datatables is happening: this line https://github.com/openrewrite/rewrite-spring/blob/0af9942357688f00147743762dcdf9680bf34bab/src/main/java/org/openrewrite/java/spring/search/FindSpringComponents.java#L77
Should be sufficient to add
springComponents.insertRow(ctx, new SpringComponents.Row(getCursor().firstEnclosingOrThrow(SourceFile.class).getSourcePath().toString(), TypeUtils.asFullyQualified(requireNonNull(m.getReturnTypeExpression()).getType())));
We can provide PR once it is indicated that would indeed be "expected"/wanted