Nuget package id ignores the case of the name and version when comparing.
@@ -31,12 +31,15 @@ class NugetPackageId {
@SerializedName('Name')
String name
+ @SerializedName('Version')
+ String version
+
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- result = prime * result + ((version == null) ? 0 : version.hashCode());
+ result = prime * result + ((name == null) ? 0 : name.toLowerCase().hashCode());
+ result = prime * result + ((version == null) ? 0 : version.toLowerCase().hashCode());
return result;
}
@@ -53,21 +56,19 @@ class NugetPackageId {
if (other.name != null) {
return false;
}
- } else if (!name.equals(other.name)) {
+ } else if (!name.equalsIgnoreCase(other.name)) {
return false;
}
if (version == null) {
if (other.version != null) {
return false;
}
- } else if (!version.equals(other.version)) {
+ } else if (!version.equalsIgnoreCase(other.version)) {
return false;
}
return true;
}
- @SerializedName('Version')
- String version
@Override
String toString() {
