Skip to content

Commit ca6724a

Browse files
committed
Merge pull request #3415 from martinjos/legacy-lib-link-bug-3412
Handle duplicates of legacy libs correctly. (#3412)
2 parents c5b1d86 + ba09c75 commit ca6724a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

arduino-core/src/cc/arduino/contributions/libraries/ContributedLibrary.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,10 @@ public boolean equals(Object obj) {
137137
String thisVersion = getParsedVersion();
138138
String otherVersion = ((ContributedLibrary) obj).getParsedVersion();
139139

140-
boolean versionEquals = thisVersion != null && otherVersion != null && thisVersion.equals(otherVersion);
140+
// Important: for legacy libs, versions are null. Two legacy libs must
141+
// always pass this test.
142+
boolean versionEquals = thisVersion == otherVersion ||
143+
(thisVersion != null && otherVersion != null && thisVersion.equals(otherVersion));
141144

142145
String thisName = getName();
143146
String otherName = ((ContributedLibrary) obj).getName();

0 commit comments

Comments
 (0)