Better rewrite recipe integration into IDE quick fix and assist

This commit is contained in:
aboyko
2022-06-22 15:17:14 -04:00
committed by aboyko
parent a02f8d378d
commit 722a8cf6d5
47 changed files with 1687 additions and 1466 deletions

View File

@@ -12,6 +12,7 @@ package org.springframework.ide.vscode.commons.java;
import java.io.File;
import java.util.List;
import java.util.function.Predicate;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
@@ -145,4 +146,25 @@ public class SpringProjectUtil {
}
return null;
}
public static Predicate<IJavaProject> springBootVersionGreaterOrEqual(int major, int minor, int patch) {
return project -> {
Version version = getDependencyVersion(project, SPRING_BOOT);
if (version == null) {
return false;
}
if (major > version.getMajor()) {
return false;
}
if (major == version.getMajor()) {
if (minor > version.getMinor()) {
return false;
}
if (minor == version.getMinor()) {
return patch <= version.getPatch();
}
}
return true;
};
}
}