Handle duplicates of legacy libs correctly. (#3412)

This commit is contained in:
Martin Sidaway 2015-06-24 17:58:31 +01:00
parent 98eb1a9ee2
commit ba09c7511c
1 changed files with 4 additions and 1 deletions

View File

@ -142,7 +142,10 @@ public abstract class ContributedLibrary extends DownloadableContribution {
String thisVersion = getParsedVersion();
String otherVersion = ((ContributedLibrary) obj).getParsedVersion();
boolean versionEquals = thisVersion != null && otherVersion != null && thisVersion.equals(otherVersion);
// Important: for legacy libs, versions are null. Two legacy libs must
// always pass this test.
boolean versionEquals = thisVersion == otherVersion ||
(thisVersion != null && otherVersion != null && thisVersion.equals(otherVersion));
String thisName = getName();
String otherName = ((ContributedLibrary) obj).getName();