| 620 | | toDownload.removeIf(info -> !missingRequiredPlugin.contains(info.getName())); |
| | 620 | toDownload.removeIf(info -> !missingRequiredPlugin.contains(info.getName()) |
| | 621 | && !missingRequiredPlugin.contains(info.provides) && info.isForCurrentPlatform()); |
| | 622 | // Remove duplicates |
| | 623 | // TODO: Make a gui? Currently, only JavaFX has multiple, and all for different platforms.) |
| | 624 | Set<String> possibleDuplicates = toDownload.parallelStream() |
| | 625 | .collect(Collectors.groupingBy(i -> i.provides == null ? i.getName() : i.provides, Collectors.counting())) |
| | 626 | .entrySet().stream().filter(e -> e.getValue() > 1).map(Map.Entry::getKey).collect(Collectors.toSet()); |
| | 627 | toDownload.removeIf(i -> possibleDuplicates.contains(i.getName()) || possibleDuplicates.contains(i.provides)); |