File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
arduino-core/src/cc/arduino/contributions/libraries Expand file tree Collapse file tree 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) {
166166 String thisVersion = getParsedVersion ();
167167 String otherVersion = other .getParsedVersion ();
168168
169- boolean versionEquals = (thisVersion != null && otherVersion != null
169+ boolean versionEquals = (thisVersion != null
170170 && thisVersion .equals (otherVersion ));
171171
172172 // Important: for legacy libs, versions are null. Two legacy libs must
@@ -176,9 +176,14 @@ public boolean equals(Object obj) {
176176
177177 String thisName = getName ();
178178 String otherName = other .getName ();
179-
180- boolean nameEquals = thisName == null || otherName == null || thisName .equals (otherName );
179+ boolean nameEquals = thisName != null && thisName .equals (otherName );
181180
182181 return versionEquals && nameEquals ;
183182 }
183+
184+ @ Override
185+ public int hashCode () {
186+ String hashingData = "CONTRIBUTEDLIB" + getName () + getVersion ();
187+ return hashingData .hashCode ();
188+ }
184189}
You can’t perform that action at this time.
0 commit comments