1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-03-15 12:29:26 +01:00

Small makeup for ContributedLibrary.equals()

This commit is contained in:
Cristian Maglie 2017-01-25 15:31:16 +01:00
parent 3d0a153c04
commit 2048ae264b

View File

@ -133,9 +133,9 @@ public abstract class ContributedLibrary extends DownloadableContribution {
if (!(obj instanceof ContributedLibrary)) { if (!(obj instanceof ContributedLibrary)) {
return false; return false;
} }
ContributedLibrary other = (ContributedLibrary) obj;
String thisVersion = getParsedVersion(); String thisVersion = getParsedVersion();
String otherVersion = ((ContributedLibrary) obj).getParsedVersion(); String otherVersion = other.getParsedVersion();
boolean versionEquals = (thisVersion != null && otherVersion != null boolean versionEquals = (thisVersion != null && otherVersion != null
&& thisVersion.equals(otherVersion)); && thisVersion.equals(otherVersion));
@ -146,7 +146,7 @@ public abstract class ContributedLibrary extends DownloadableContribution {
versionEquals = true; versionEquals = true;
String thisName = getName(); String thisName = getName();
String otherName = ((ContributedLibrary) obj).getName(); String otherName = other.getName();
boolean nameEquals = thisName == null || otherName == null || thisName.equals(otherName); boolean nameEquals = thisName == null || otherName == null || thisName.equals(otherName);