Skip to content

Commit

Permalink
Minor code cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Gary O'Neall <gary@sourceauditor.com>
  • Loading branch information
goneall committed Dec 10, 2023
1 parent 3062147 commit b488e51
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void text(String text) {
currentString.append(text);
} else if (OptionalTextHandling.REGEX_USING_TOKENS.equals(optionalTextHandling)) {
optionalTokens.get(optionalDepth).addAll(Arrays.asList(
LicenseCompareHelper.tokenizeLicenseText(text, new HashMap<Integer, LineColumn>())));
LicenseCompareHelper.tokenizeLicenseText(text, new HashMap<>())));
}
}

Expand Down Expand Up @@ -140,12 +140,11 @@ public void beginOptional(LicenseTemplateRule rule) {
}

/**
* @param tokens list of tokens
* @return regular expression with quoted tokens
*/
private String toTokenRegex(List<String> tokens) {
StringBuilder sb = new StringBuilder();
for (String token:optionalTokens.get(optionalDepth)) {
for (String token:tokens) {
token = token.trim();
if (LicenseCompareHelper.NORMALIZE_TOKENS.containsKey(token.toLowerCase())) {
token = LicenseCompareHelper.NORMALIZE_TOKENS.get(token.toLowerCase());
Expand Down

0 comments on commit b488e51

Please sign in to comment.