|
|
@@ -366,7 +366,6 @@ public final class SelectorUtils { |
|
|
int patIdxEnd = patArr.length - 1; |
|
|
int patIdxEnd = patArr.length - 1; |
|
|
int strIdxStart = 0; |
|
|
int strIdxStart = 0; |
|
|
int strIdxEnd = strArr.length - 1; |
|
|
int strIdxEnd = strArr.length - 1; |
|
|
char ch; |
|
|
|
|
|
|
|
|
|
|
|
boolean containsStar = false; |
|
|
boolean containsStar = false; |
|
|
for (char ch : patArr) { |
|
|
for (char ch : patArr) { |
|
|
@@ -382,7 +381,7 @@ public final class SelectorUtils { |
|
|
return false; // Pattern and string do not have the same size |
|
|
return false; // Pattern and string do not have the same size |
|
|
} |
|
|
} |
|
|
for (int i = 0; i <= patIdxEnd; i++) { |
|
|
for (int i = 0; i <= patIdxEnd; i++) { |
|
|
ch = patArr[i]; |
|
|
|
|
|
|
|
|
char ch = patArr[i]; |
|
|
if (ch != '?') { |
|
|
if (ch != '?') { |
|
|
if (different(caseSensitive, ch, strArr[i])) { |
|
|
if (different(caseSensitive, ch, strArr[i])) { |
|
|
return false; // Character mismatch |
|
|
return false; // Character mismatch |
|
|
@@ -398,7 +397,7 @@ public final class SelectorUtils { |
|
|
|
|
|
|
|
|
// Process characters before first star |
|
|
// Process characters before first star |
|
|
while (true) { |
|
|
while (true) { |
|
|
ch = patArr[patIdxStart]; |
|
|
|
|
|
|
|
|
char ch = patArr[patIdxStart]; |
|
|
if (ch == '*' || strIdxStart > strIdxEnd) { |
|
|
if (ch == '*' || strIdxStart > strIdxEnd) { |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
@@ -418,7 +417,7 @@ public final class SelectorUtils { |
|
|
|
|
|
|
|
|
// Process characters after last star |
|
|
// Process characters after last star |
|
|
while (true) { |
|
|
while (true) { |
|
|
ch = patArr[patIdxEnd]; |
|
|
|
|
|
|
|
|
char ch = patArr[patIdxEnd]; |
|
|
if (ch == '*' || strIdxStart > strIdxEnd) { |
|
|
if (ch == '*' || strIdxStart > strIdxEnd) { |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
@@ -459,7 +458,7 @@ public final class SelectorUtils { |
|
|
strLoop: |
|
|
strLoop: |
|
|
for (int i = 0; i <= strLength - patLength; i++) { |
|
|
for (int i = 0; i <= strLength - patLength; i++) { |
|
|
for (int j = 0; j < patLength; j++) { |
|
|
for (int j = 0; j < patLength; j++) { |
|
|
ch = patArr[patIdxStart + j + 1]; |
|
|
|
|
|
|
|
|
char ch = patArr[patIdxStart + j + 1]; |
|
|
if (ch != '?') { |
|
|
if (ch != '?') { |
|
|
if (different(caseSensitive, ch, |
|
|
if (different(caseSensitive, ch, |
|
|
strArr[strIdxStart + i + j])) { |
|
|
strArr[strIdxStart + i + j])) { |
|
|
|