diff --git a/project-management/src/main/java/life/qbic/projectmanagement/domain/model/OntologyTerm.java b/project-management/src/main/java/life/qbic/projectmanagement/domain/model/OntologyTerm.java index 922b57f5b..f85b345fb 100644 --- a/project-management/src/main/java/life/qbic/projectmanagement/domain/model/OntologyTerm.java +++ b/project-management/src/main/java/life/qbic/projectmanagement/domain/model/OntologyTerm.java @@ -137,47 +137,20 @@ public String formatted() { } @Override - public boolean equals(Object object) { - if (this == object) { + public boolean equals(Object other) { + if (this == other) { return true; } - if (object == null || getClass() != object.getClass()) { - return false; - } - - OntologyTerm that = (OntologyTerm) object; - - if (!Objects.equals(ontologyAbbreviation, that.ontologyAbbreviation)) { - return false; - } - if (!Objects.equals(ontologyVersion, that.ontologyVersion)) { - return false; - } - if (!Objects.equals(ontologyIri, that.ontologyIri)) { - return false; - } - if (!Objects.equals(classLabel, that.classLabel)) { - return false; - } - if (!Objects.equals(oboId, that.oboId)) { - return false; - } - if (!Objects.equals(description, that.description)) { + if (other == null || getClass() != other.getClass()) { return false; } + OntologyTerm that = (OntologyTerm) other; return Objects.equals(classIri, that.classIri); } @Override public int hashCode() { - int result = ontologyAbbreviation != null ? ontologyAbbreviation.hashCode() : 0; - result = 31 * result + (ontologyVersion != null ? ontologyVersion.hashCode() : 0); - result = 31 * result + (ontologyIri != null ? ontologyIri.hashCode() : 0); - result = 31 * result + (classLabel != null ? classLabel.hashCode() : 0); - result = 31 * result + (oboId != null ? oboId.hashCode() : 0); - result = 31 * result + (description != null ? description.hashCode() : 0); - result = 31 * result + (classIri != null ? classIri.hashCode() : 0); - return result; + return Objects.hashCode(classIri); } @Override diff --git a/user-interface/src/main/bundles/dev.bundle b/user-interface/src/main/bundles/dev.bundle index 88973dba1..606027cea 100644 Binary files a/user-interface/src/main/bundles/dev.bundle and b/user-interface/src/main/bundles/dev.bundle differ diff --git a/user-interface/src/main/java/life/qbic/datamanager/views/projects/project/info/ProjectSummaryComponent.java b/user-interface/src/main/java/life/qbic/datamanager/views/projects/project/info/ProjectSummaryComponent.java index 4155d9e83..4beb0c251 100644 --- a/user-interface/src/main/java/life/qbic/datamanager/views/projects/project/info/ProjectSummaryComponent.java +++ b/user-interface/src/main/java/life/qbic/datamanager/views/projects/project/info/ProjectSummaryComponent.java @@ -452,15 +452,15 @@ private OntologyTermDisplay convert(OntologyTerm ontologyTerm) { } private List extractSpecies(List experiments) { - return experiments.stream().flatMap(experiment -> experiment.getSpecies().stream()).toList(); + return experiments.stream().flatMap(experiment -> experiment.getSpecies().stream()).distinct().toList(); } private List extractSpecimen(List experiments) { - return experiments.stream().flatMap(experiment -> experiment.getSpecimens().stream()).toList(); + return experiments.stream().flatMap(experiment -> experiment.getSpecimens().stream()).distinct().toList(); } private List extractAnalyte(List experiments) { - return experiments.stream().flatMap(experiment -> experiment.getAnalytes().stream()).toList(); + return experiments.stream().flatMap(experiment -> experiment.getAnalytes().stream()).distinct().toList(); } private void buildDesignSection(ProjectOverview projectInformation, Project project) {