Skip to content

Commit 5a17846

Browse files
author
jan
committed
Fix regression from #1727
The private and board libs did not really work
1 parent b712f2e commit 5a17846

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

io.sloeber.core/src/io/sloeber/arduinoFramework/internal/ArduinoLibraryVersion.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,4 +223,12 @@ public IPath getFQN() {
223223
public boolean equals(IArduinoLibraryVersion other) {
224224
return myFQN.equals(other.getFQN());
225225
}
226+
227+
@Override
228+
public boolean equals(Object other) {
229+
if(other instanceof IArduinoLibraryVersion) {
230+
return equals((IArduinoLibraryVersion) other);
231+
}
232+
return false;
233+
}
226234
}

io.sloeber.core/src/io/sloeber/core/internal/ArduinoHardwareLibrary.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ public boolean equals(Object other) {
9494

9595
@Override
9696
public int compareTo(IArduinoLibraryVersion other) {
97+
if (other == null) {
98+
return 1;
99+
}
97100
return myFQN.toPortableString().compareTo(other.getFQN().toPortableString());
98101
}
99102

io.sloeber.core/src/io/sloeber/core/internal/ArduinoPrivateHardwareLibraryVersion.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,19 @@ public boolean equals(IArduinoLibraryVersion other) {
8787
}
8888

8989
@Override
90-
public int compareTo(IArduinoLibraryVersion o) {
91-
return 0;
90+
public boolean equals(Object other) {
91+
if(other instanceof IArduinoLibraryVersion) {
92+
return equals((IArduinoLibraryVersion) other);
93+
}
94+
return false;
95+
}
96+
97+
@Override
98+
public int compareTo(IArduinoLibraryVersion other) {
99+
if (other == null) {
100+
return 1;
101+
}
102+
return myFQN.toPortableString().compareTo(other.getFQN().toPortableString());
92103
}
93104

94105
@Override

0 commit comments

Comments
 (0)