0
0
mirror of https://github.com/TrianguloY/UrlChecker.git synced 2024-09-19 20:02:16 +02:00

correctly fix NewApi lint error

This commit is contained in:
TrianguloY 2023-06-10 13:41:28 +02:00
parent dff73c1e63
commit 837f3d6148

View File

@ -91,12 +91,12 @@ public class RegexFix {
}
dollar = false;
} else if (c == '{' && dollar) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
throw new IllegalArgumentException("your android version does not support named-capturing groups");
}
escapeNamedGroup = true;
escapeNamedGroupStart = i;
} else if (c == '}' && dollar && escapeNamedGroup) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
throw new IllegalArgumentException("your android version does not support named-capturing groups");
}
String groupValue = matcher.group(s.substring(escapeNamedGroupStart + 1, i));
if (groupValue != null) {
buffer.append(groupValue);