@@ -454,10 +454,10 @@ public static boolean isStandardLicenseWithinText(String text, ListedLicense lic
454
454
* @return True if the license exception is found within the text, false otherwise (or if either argument is null)
455
455
*/
456
456
public static boolean isStandardLicenseExceptionWithinText (String text , ListedLicenseException exception ) {
457
- boolean result = false ;
458
457
if (text == null || text .isEmpty () || exception == null ) {
459
458
return false ;
460
459
}
460
+ boolean result = false ;
461
461
try {
462
462
return new TemplateRegexMatcher (exception .getStandardAdditionTemplate ().orElse (exception .getAdditionText ())).isTemplateMatchWithinText (text );
463
463
} catch (SpdxCompareException e ) {
@@ -796,7 +796,6 @@ public static DifferenceDescription isTextStandardException(org.spdx.library.mod
796
796
* @return True if the license is found within the text, false otherwise (or if either argument is null)
797
797
*/
798
798
public static boolean isStandardLicenseWithinText (String text , org .spdx .library .model .v2 .license .SpdxListedLicense license ) {
799
-
800
799
try {
801
800
return new TemplateRegexMatcher (license .getStandardLicenseTemplate ()).isTemplateMatchWithinText (text );
802
801
} catch (SpdxCompareException e ) {
@@ -816,10 +815,10 @@ public static boolean isStandardLicenseWithinText(String text, org.spdx.library.
816
815
* @return True if the license exception is found within the text, false otherwise (or if either argument is null)
817
816
*/
818
817
public static boolean isStandardLicenseExceptionWithinText (String text , org .spdx .library .model .v2 .license .ListedLicenseException exception ) {
819
- boolean result = false ;
820
818
if (text == null || text .isEmpty () || exception == null ) {
821
819
return false ;
822
820
}
821
+ boolean result = false ;
823
822
try {
824
823
return new TemplateRegexMatcher (exception .getLicenseExceptionTemplate ()).isTemplateMatchWithinText (text );
825
824
} catch (SpdxCompareException e ) {
@@ -902,4 +901,4 @@ public static boolean isLicensePassWhiteList(
902
901
}
903
902
}
904
903
905
- }
904
+ }
0 commit comments