diff --git a/gsrs-module-substance-example/src/main/resources/gsrs-h2-local.conf b/gsrs-module-substance-example/src/main/resources/gsrs-h2-local.conf index 5377e4448..546d6d391 100644 --- a/gsrs-module-substance-example/src/main/resources/gsrs-h2-local.conf +++ b/gsrs-module-substance-example/src/main/resources/gsrs-h2-local.conf @@ -3,7 +3,7 @@ ix.h2 { } spring.datasource.url="jdbc:h2:"${ix.h2.base}"/ginas;mv_store=false" -spring.datasource.username=sa +spring.datasource.username="" spring.datasource.password="" spring.datasource.driverClassName=org.h2.Driver spring.jpa.database-platform=org.hibernate.dialect.H2Dialect diff --git a/gsrs-module-substances-core/src/main/java/ix/ginas/utils/validation/ValidationUtils.java b/gsrs-module-substances-core/src/main/java/ix/ginas/utils/validation/ValidationUtils.java index 4316a1f73..b00f4fca0 100644 --- a/gsrs-module-substances-core/src/main/java/ix/ginas/utils/validation/ValidationUtils.java +++ b/gsrs-module-substances-core/src/main/java/ix/ginas/utils/validation/ValidationUtils.java @@ -1799,10 +1799,17 @@ public static List findLayerNDefinitionalDuplicateCandidates(Substanc try { SearchOptions options = new SearchOptions(); SearchResult sr = defHashCalcRequirements.getSubstanceLegacySearchService().search(request.getQuery(), options); + + //this might not be necessary anymore sr.waitForFinish(); - List fut = sr.getMatches(); - List hits = (List) fut.stream() - .map(s -> (Substance) s) + + List fut = sr.getMatches(); + List hits = fut.stream() + .map(s ->(Substance)s) + .filter(ss->{ + //filter out exact matches + return !substance.getOrGenerateUUID().equals(ss.getOrGenerateUUID()); + }) .collect(Collectors.toList()); return hits; } catch (Exception ex) {