]> gerrit.simantics Code Review - simantics/district.git/commitdiff
Avoid exception for non-unique keys in tech type table 89/4489/1
authorReino Ruusu <reino.ruusu@semantum.fi>
Fri, 9 Oct 2020 06:02:28 +0000 (09:02 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 9 Oct 2020 07:54:30 +0000 (07:54 +0000)
gitlab #93

Change-Id: I6c258b4dd11403419a7a1dd986ec449ea7602e4e
(cherry picked from commit dcfefc75af1dbd93f8647e24a09053d2638d2f57)

org.simantics.district.network/src/org/simantics/district/network/techtype/requests/TechTypeTableData.java

index 60929eddc999c56aad719616ba81bc21f90ade44..e09db0ac87cbd72bcdc872b993cf236cb7811c97 100644 (file)
@@ -63,7 +63,7 @@ public class TechTypeTableData extends BinaryRead<Resource, Boolean, Map<String,
                
                return enabled
                                .filter(r -> r.containsKey(keyName))
-                               .collect(Collectors.toMap(r -> r.get(keyName), r -> r));
+                               .collect(Collectors.toMap(r -> r.get(keyName), r -> r, (p, q) -> p));
        }
 
        private String getKeyName(ReadGraph graph, Resource table) throws DatabaseException {