private boolean checkCompatibleVersions(List<String> compatibleVersions, String toolVersion) {
for (String version : compatibleVersions) {
int matches = StringUtils.countMatches(version, "*");
if (matches > 1) continue;
if (version.length() == toolVersion.length()) {
char[] versionChars = version.toCharArray();
char[] toolVersionChars = toolVersion.toCharArray();
int versionIndex = 0;
while (versionIndex < versionChars.length) {
if (versionChars[versionIndex] == toolVersionChars[versionIndex] || versionChars[versionIndex] == '*') {
versionIndex++;
} else {
break;
}
}
if (versionIndex == versionChars.length) {
return true;
}
}
}
return false;
}
08-25
1413
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)