Adopt Rewrite snapshots. Upgrade antlr to 4.11
This commit is contained in:
@@ -309,7 +309,11 @@ public class RewriteRecipeRepository implements ApplicationContextAware {
|
||||
for (RecipeCodeActionDescriptor d : descriptors) {
|
||||
TreeVisitor<?, ExecutionContext> markVisitor = d.getMarkerVisitor(applicationContext);
|
||||
if (markVisitor != null) {
|
||||
cu = (CompilationUnit) markVisitor.visit(cu, new InMemoryExecutionContext(e -> log.error("Marker visitor failed!", e)));
|
||||
try {
|
||||
cu = (CompilationUnit) markVisitor.visit(cu, new InMemoryExecutionContext(e -> log.error("Marker visitor failed!", e)));
|
||||
} catch (Exception e) {
|
||||
// ignore - would happen in sources with compiler errors
|
||||
}
|
||||
}
|
||||
}
|
||||
return cu;
|
||||
|
||||
@@ -110,13 +110,13 @@ public class SpringBootUpgrade {
|
||||
String recipeId = recipedIds.get(recipedIds.size() - 1);
|
||||
// TODO: Review after new rewrite adoption
|
||||
// Special case is UpgradeSpringBoot_3_0 which doesn't upgrade project to the latest 2.x if necessary. Therefore add 2.(latest) recipe (it chains all previous 2.x)
|
||||
if (targetVersion.getMajor() == 3) {
|
||||
int i = recipedIds.size() - 1;
|
||||
for (; i>=0 && !getVersionFromRecipeId(recipedIds.get(i)).startsWith("2."); i--) {}
|
||||
if (i >= 0) {
|
||||
getRecipeFromId(recipedIds.get(i)).ifPresent(recipe::doNext);
|
||||
}
|
||||
}
|
||||
// if (targetVersion.getMajor() == 3) {
|
||||
// int i = recipedIds.size() - 1;
|
||||
// for (; i>=0 && !getVersionFromRecipeId(recipedIds.get(i)).startsWith("2."); i--) {}
|
||||
// if (i >= 0) {
|
||||
// getRecipeFromId(recipedIds.get(i)).ifPresent(recipe::doNext);
|
||||
// }
|
||||
// }
|
||||
getRecipeFromId(recipeId).ifPresent(recipe::doNext);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user