1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-01 01:55:59 +01:00

Fix Android compatibility by using Matcher.group(int) instead of Matcher.group(String)

This commit is contained in:
Paul Schaub 2022-12-20 17:27:32 +01:00
parent 94851ccb8f
commit 75f69c0473
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -92,9 +92,9 @@ public final class UserId implements CharSequence {
string = string.trim(); string = string.trim();
Matcher matcher = nameAddrPattern.matcher(string); Matcher matcher = nameAddrPattern.matcher(string);
if (matcher.find()) { if (matcher.find()) {
String name = matcher.group("name"); String name = matcher.group(2);
String comment = matcher.group("comment"); String comment = matcher.group(4);
String mail = matcher.group("email"); String mail = matcher.group(6);
matcher = emailPattern.matcher(mail); matcher = emailPattern.matcher(mail);
if (!matcher.matches()) { if (!matcher.matches()) {
throw new IllegalArgumentException("Malformed email address"); throw new IllegalArgumentException("Malformed email address");