mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-14 11:29:26 +01:00
Small makeup for ContributedLibrary.equals()
This commit is contained in:
parent
3d0a153c04
commit
2048ae264b
@ -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);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user