-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error: MigrateCollectionsSingletonList recipe error #186
Comments
root causeSource code setConnectionListeners(Collections.singletonList(new ConnectionListener() {
@Override
public void onCreate() {
}
})); this is the stub generated by class A {
public void setConnectionListeners(List<? extends ConnectionListener> listeners) {
}
public void test() {
__M__.any(
/*__TEMPLATE__*/List.of(__P__.<A .1 >/*__p0__*/p())/*__TEMPLATE_STOP__*/
);
}
} since in the source, there is no assignment, the generic type of The stop comment is not able to be captured since it's somewhere before the target statement, so the order is the visitor caught
Compared to a working case: List<LocalDate> list = Collections.singletonList(LocalDate.now()); The generated template stub is class Test {
List<String> list =
/*__TEMPLATE__*/List.of(__P__.<String>/*__p0__*/p())/*__TEMPLATE_STOP__*/;
} this works because there is no more statement to capture at the end, but not because the |
Got this error when running recipe
org.openrewrite.java.migrate.UpgradeToJava17
on repo https://github.com/spring-projects/spring-amqpError:
Message:
Detail:
The text was updated successfully, but these errors were encountered: