Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -454,10 +454,10 @@ public static boolean isStandardLicenseWithinText(String text, ListedLicense lic
* @return True if the license exception is found within the text, false otherwise (or if either argument is null)
*/
public static boolean isStandardLicenseExceptionWithinText(String text, ListedLicenseException exception) {
boolean result = false;
if (text == null || text.isEmpty() || exception == null) {
return false;
}
boolean result = false;
try {
return new TemplateRegexMatcher(exception.getStandardAdditionTemplate().orElse(exception.getAdditionText())).isTemplateMatchWithinText(text);
} catch (SpdxCompareException e) {
Expand Down Expand Up @@ -796,7 +796,6 @@ public static DifferenceDescription isTextStandardException(org.spdx.library.mod
* @return True if the license is found within the text, false otherwise (or if either argument is null)
*/
public static boolean isStandardLicenseWithinText(String text, org.spdx.library.model.v2.license.SpdxListedLicense license) {

try {
return new TemplateRegexMatcher(license.getStandardLicenseTemplate()).isTemplateMatchWithinText(text);
} catch (SpdxCompareException e) {
Expand All @@ -816,10 +815,10 @@ public static boolean isStandardLicenseWithinText(String text, org.spdx.library.
* @return True if the license exception is found within the text, false otherwise (or if either argument is null)
*/
public static boolean isStandardLicenseExceptionWithinText(String text, org.spdx.library.model.v2.license.ListedLicenseException exception) {
boolean result = false;
if (text == null || text.isEmpty() || exception == null) {
return false;
}
boolean result = false;
try {
return new TemplateRegexMatcher(exception.getLicenseExceptionTemplate()).isTemplateMatchWithinText(text);
} catch (SpdxCompareException e) {
Expand Down Expand Up @@ -902,4 +901,4 @@ public static boolean isLicensePassWhiteList(
}
}

}
}