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 @@ -137,7 +137,7 @@ public boolean equals(Object obj) {
137
137
String thisVersion = getParsedVersion ();
138
138
String otherVersion = other .getParsedVersion ();
139
139
140
- boolean versionEquals = (thisVersion != null && otherVersion != null
140
+ boolean versionEquals = (thisVersion != null
141
141
&& thisVersion .equals (otherVersion ));
142
142
143
143
// Important: for legacy libs, versions are null. Two legacy libs must
@@ -147,9 +147,14 @@ public boolean equals(Object obj) {
147
147
148
148
String thisName = getName ();
149
149
String otherName = other .getName ();
150
-
151
- boolean nameEquals = thisName == null || otherName == null || thisName .equals (otherName );
150
+ boolean nameEquals = thisName != null && thisName .equals (otherName );
152
151
153
152
return versionEquals && nameEquals ;
154
153
}
154
+
155
+ @ Override
156
+ public int hashCode () {
157
+ String hashingData = "CONTRIBUTEDLIB" + getName () + getVersion ();
158
+ return hashingData .hashCode ();
159
+ }
155
160
}
You can’t perform that action at this time.
0 commit comments