[MNG-7902] Sort plugins in the validation report (#1510)

Co-authored-by: Yueh Chun Wu <kevinwu@YuehdeMBP.attlocal.net>
This commit is contained in:
Yueh Chun Wu 2024-05-23 05:25:04 -07:00 committed by GitHub
parent 6e9889b1ad
commit dd9679450e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 1 deletions

View File

@ -23,6 +23,7 @@ import javax.inject.Singleton;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
@ -222,7 +223,12 @@ public final class DefaultPluginValidationManager extends AbstractEventSpy imple
logger.warn(""); logger.warn("");
logger.warn("Plugin {} validation issues were detected in following plugin(s)", issueLocalitiesToReport); logger.warn("Plugin {} validation issues were detected in following plugin(s)", issueLocalitiesToReport);
logger.warn(""); logger.warn("");
for (Map.Entry<String, PluginValidationIssues> entry : issuesMap.entrySet()) {
// Sorting the plugins
List<Map.Entry<String, PluginValidationIssues>> sortedEntries = new ArrayList<>(issuesMap.entrySet());
sortedEntries.sort(Map.Entry.comparingByKey(String.CASE_INSENSITIVE_ORDER));
for (Map.Entry<String, PluginValidationIssues> entry : sortedEntries) {
PluginValidationIssues issues = entry.getValue(); PluginValidationIssues issues = entry.getValue();
if (!hasAnythingToReport(issues, issueLocalitiesToReport)) { if (!hasAnythingToReport(issues, issueLocalitiesToReport)) {
continue; continue;