File tree 1 file changed +8
-3
lines changed
arduino-core/src/cc/arduino/contributions/libraries
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ public boolean equals(Object obj) {
166
166
String thisVersion = getParsedVersion ();
167
167
String otherVersion = other .getParsedVersion ();
168
168
169
- boolean versionEquals = (thisVersion != null && otherVersion != null
169
+ boolean versionEquals = (thisVersion != null
170
170
&& thisVersion .equals (otherVersion ));
171
171
172
172
// Important: for legacy libs, versions are null. Two legacy libs must
@@ -176,9 +176,14 @@ public boolean equals(Object obj) {
176
176
177
177
String thisName = getName ();
178
178
String otherName = other .getName ();
179
-
180
- boolean nameEquals = thisName == null || otherName == null || thisName .equals (otherName );
179
+ boolean nameEquals = thisName != null && thisName .equals (otherName );
181
180
182
181
return versionEquals && nameEquals ;
183
182
}
183
+
184
+ @ Override
185
+ public int hashCode () {
186
+ String hashingData = "CONTRIBUTEDLIB" + getName () + getVersion ();
187
+ return hashingData .hashCode ();
188
+ }
184
189
}
You can’t perform that action at this time.
0 commit comments