Skip to content

Commit ef9090e

Browse files
committed
replaced Comparator with Comparable
1 parent d12ed0d commit ef9090e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

it.baeyens.arduino.core/src/it/baeyens/arduino/managers/Library.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import it.baeyens.arduino.common.ConfigurationPreferences;
2222
import it.baeyens.arduino.ui.Activator;
2323

24-
public class Library implements Comparator<Library> {
24+
public class Library implements Comparable<Library> {
2525

2626
private String name;
2727
private String version;
@@ -210,8 +210,8 @@ public Collection<Path> getSources(IProject project) {
210210
}
211211

212212
@Override
213-
public int compare(Library o1, Library o2) {
214-
return o1.getName().compareTo(o2.getName());
213+
public int compareTo(Library other) {
214+
return this.name.compareTo(other.name);
215215
}
216216

217217
public IStatus remove(IProgressMonitor monitor) {

it.baeyens.arduino.core/src/it/baeyens/arduino/ui/LibraryPreferencePage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ private void updateTable() {
109109
for (String curCategory : categories) {
110110
Collection<Library> libraries = libraryIndex.getLibraries(curCategory);
111111
List<Library> librarylist = new ArrayList<>(libraries);
112-
Collections.sort(librarylist, new Library());
112+
Collections.sort(librarylist);
113113

114114
String prefLibraryName = null;
115115
TableItem libraryItem = null;

0 commit comments

Comments
 (0)