Update ThirdPartyAuditTask to check for and list pointless exclusions. (#2760)

This change swaps the order of the task to first check for no pointless exclusions.
If not caught first these will be thrown inside of the bogusExcludesCount block that logs a
useless error message.

Signed-off-by: Marc Handalian <handalm@amazon.com>
This commit is contained in:
Marc Handalian 2022-04-04 21:18:32 -07:00 committed by GitHub
parent 6103010e14
commit 21f9950806
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -237,6 +237,7 @@ public class ThirdPartyAuditTask extends DefaultTask {
Set<String> jdkJarHellClasses = runJdkJarHellCheck();
if (missingClassExcludes != null) {
assertNoPointlessExclusions("are not missing", missingClassExcludes, missingClasses);
long bogousExcludesCount = Stream.concat(missingClassExcludes.stream(), violationsExcludes.stream())
.filter(each -> missingClasses.contains(each) == false)
.filter(each -> violationsClasses.contains(each) == false)
@ -247,7 +248,6 @@ public class ThirdPartyAuditTask extends DefaultTask {
"All excluded classes seem to have no issues. " + "This is sometimes an indication that the check silently failed"
);
}
assertNoPointlessExclusions("are not missing", missingClassExcludes, missingClasses);
missingClasses.removeAll(missingClassExcludes);
}
assertNoPointlessExclusions("have no violations", violationsExcludes, violationsClasses);