Skip to content

Commit

Permalink
Fix security issue being reported by Sonarcloud
Browse files Browse the repository at this point in the history
  • Loading branch information
kwin committed Jul 8, 2024
1 parent b7ef26d commit 0b64956
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ public Validator createValidator(@NotNull ValidationContext context, @NotNull Va
}

static @NotNull Collection<TypeSettings> parseTypesSettings(String option) {
return Pattern.compile("\\s*,\\s*").splitAsStream(option)
return Pattern.compile(",").splitAsStream(option)
.map(String::trim) // ignore whitespaces around ","
.map(AemReplicationMetadataValidatorFactory::parseTypeSettings)
.collect(Collectors.toList());
}
Expand All @@ -118,7 +119,7 @@ public Validator createValidator(@NotNull ValidationContext context, @NotNull Va
if (entry.charAt(endType+1) != ';') {
throw new IllegalArgumentException("Each entry may either end with the type enclosed by \"[\" and \"]\" or some attributes separated by \";\"");
}
String attributes = entry.substring(endType+2);
String attributes = entry.substring(endType+2).trim(); // ignore whitespaces around ";"
parseAttributes(typeSettings, attributes);
}
return typeSettings;
Expand Down

0 comments on commit 0b64956

Please sign in to comment.