Fixed broken usage of metadata addition. Fixed equals of two elements.

This commit is contained in:
Kai Zimmermann
2016-03-30 09:49:25 +02:00
parent ca17f4543a
commit c6c50c6a68
7 changed files with 33 additions and 28 deletions

View File

@@ -139,6 +139,9 @@ public class DistributionSet extends NamedVersionedEntity {
return deleted;
}
/**
* @return immutable list of meta data elements.
*/
public List<DistributionSetMetadata> getMetadata() {
return Collections.unmodifiableList(metadata);
}

View File

@@ -220,6 +220,9 @@ public class SoftwareModule extends NamedVersionedEntity {
this.type = type;
}
/**
* @return immutable list of meta data elements.
*/
public List<SoftwareModuleMetadata> getMetadata() {
return Collections.unmodifiableList(metadata);
}

View File

@@ -102,9 +102,8 @@ public class SoftwareModuleMetadata implements Serializable {
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (key == null ? 0 : key.hashCode());
result = prime * result + (softwareModule == null ? 0 : softwareModule.hashCode());
result = prime * result + (value == null ? 0 : value.hashCode());
result = prime * result + ((key == null) ? 0 : key.hashCode());
result = prime * result + ((softwareModule == null) ? 0 : softwareModule.hashCode());
return result;
}
@@ -116,7 +115,7 @@ public class SoftwareModuleMetadata implements Serializable {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
if (!(obj instanceof SoftwareModuleMetadata)) {
return false;
}
final SoftwareModuleMetadata other = (SoftwareModuleMetadata) obj;
@@ -134,13 +133,6 @@ public class SoftwareModuleMetadata implements Serializable {
} else if (!softwareModule.equals(other.softwareModule)) {
return false;
}
if (value == null) {
if (other.value != null) {
return false;
}
} else if (!value.equals(other.value)) {
return false;
}
return true;
}

View File

@@ -320,7 +320,8 @@ public class TargetInfo implements Persistable<Long>, Serializable {
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (target == null ? 0 : target.hashCode());
result = prime * result + ((target == null) ? 0 : target.hashCode());
result = prime * result + ((targetId == null) ? 0 : targetId.hashCode());
return result;
}
@@ -343,7 +344,13 @@ public class TargetInfo implements Persistable<Long>, Serializable {
} else if (!target.equals(other.target)) {
return false;
}
if (targetId == null) {
if (other.targetId != null) {
return false;
}
} else if (!targetId.equals(other.targetId)) {
return false;
}
return true;
}
}