Skip to content

Commit

Permalink
remove self-reference duplicates from check
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerperyea committed Oct 4, 2021
1 parent 47b8057 commit 9ac7924
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1799,10 +1799,17 @@ public static List<Substance> 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<Substance> hits = (List<Substance>) fut.stream()
.map(s -> (Substance) s)

List<Object> fut = sr.getMatches();
List<Substance> 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) {
Expand Down

0 comments on commit 9ac7924

Please sign in to comment.