From b488e51859f7713dbd15e803e044d83d5181c33b Mon Sep 17 00:00:00 2001 From: Gary O'Neall Date: Sun, 10 Dec 2023 13:49:44 -0800 Subject: [PATCH] Minor code cleanup Signed-off-by: Gary O'Neall --- .../spdx/utility/compare/FilterTemplateOutputHandler.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/spdx/utility/compare/FilterTemplateOutputHandler.java b/src/main/java/org/spdx/utility/compare/FilterTemplateOutputHandler.java index fc022789..8f667d45 100644 --- a/src/main/java/org/spdx/utility/compare/FilterTemplateOutputHandler.java +++ b/src/main/java/org/spdx/utility/compare/FilterTemplateOutputHandler.java @@ -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()))); + LicenseCompareHelper.tokenizeLicenseText(text, new HashMap<>()))); } } @@ -140,12 +140,11 @@ public void beginOptional(LicenseTemplateRule rule) { } /** - * @param tokens list of tokens * @return regular expression with quoted tokens */ private String toTokenRegex(List 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());