in dubbo-admin-server/src/main/java/org/apache/dubbo/admin/common/util/ParseUtils.java [194:219]
public static boolean hasIntersection(String glob1, String glob2) {
if (null == glob1 || null == glob2) {
return false;
}
if (glob1.contains("*") && glob2.contains("*")) {
int index1 = glob1.indexOf("*");
int index2 = glob2.indexOf("*");
String s11 = glob1.substring(0, index1);
String s12 = glob1.substring(index1 + 1, glob1.length());
String s21 = glob2.substring(0, index2);
String s22 = glob2.substring(index2 + 1, glob2.length());
if (!s11.startsWith(s21) && !s21.startsWith(s11)) return false;
if (!s12.endsWith(s22) && !s22.endsWith(s12)) return false;
return true;
} else if (glob1.contains("*")) {
return isMatchGlobPattern(glob1, glob2);
} else if (glob2.contains("*")) {
return isMatchGlobPattern(glob2, glob1);
} else {
return glob1.equals(glob2);
}
}