1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00

Fix some linter suggestions

This commit is contained in:
Cristian Maglie 2019-07-15 22:56:08 +02:00 committed by Martino Facchin
parent 745cb01ed5
commit 4dc5176c0f
3 changed files with 7 additions and 7 deletions

View File

@ -62,7 +62,7 @@ public class MultiLibraryInstallDialog extends JDialog {
ALL, NONE, CANCEL
}
Result result = Result.CANCEL;
private Result result = Result.CANCEL;
public MultiLibraryInstallDialog(Window parent, ContributedLibrary lib,
List<ContributedLibrary> dependencies) {

View File

@ -38,6 +38,8 @@ import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import cc.arduino.contributions.VersionComparator;
public abstract class LibrariesIndex {
public abstract List<ContributedLibrary> getLibraries();
@ -121,11 +123,8 @@ public abstract class LibrariesIndex {
for (ContributedLibraryDependency dep : requirements) {
// If the current solution already contains this dependency, skip over
boolean alreadyInSolution = false;
for (ContributedLibrary c : solution) {
if (c.getName().equals(dep.getName()))
alreadyInSolution = true;
}
boolean alreadyInSolution = solution.stream()
.anyMatch(l -> l.getName().equals(dep.getName()));
if (alreadyInSolution)
continue;
@ -146,7 +145,7 @@ public abstract class LibrariesIndex {
selected = installed.get();
} else {
// otherwise pick the latest version
selected = possibleDeps.stream().reduce((a, b) -> b.isBefore(a) ? a : b).get();
selected = possibleDeps.stream().reduce(VersionComparator::max).get();
}
// Add dependency to the solution and process recursively

View File

@ -73,6 +73,7 @@ public class UnavailableContributedLibrary extends ContributedLibrary {
@Override
public void setCategory(String category) {
// Empty
}
@Override