]> gerrit.simantics Code Review - simantics/district.git/commitdiff
Trim whitespace from tech type table data 63/4463/1
authorReino Ruusu <reino.ruusu@semantum.fi>
Fri, 18 Sep 2020 14:20:40 +0000 (17:20 +0300)
committerReino Ruusu <reino.ruusu@semantum.fi>
Fri, 18 Sep 2020 14:20:40 +0000 (17:20 +0300)
gitlab #93

Change-Id: I72cf316d3e99b35fdfa12e404e62a41a3e1858cf

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

index 4afe5bde5407b2ea2c9a8b5e8dedc0ddbfe1d20d..cbedd1acdf9e47ba3bc7dedef49954326b29b496 100644 (file)
@@ -75,7 +75,7 @@ public class TechTypeTableData extends ResourceRead<Map<String, Map<String, Stri
                }
 
                for (CSVRecord r : records) {
-                       String key = r.get(keyIndex).intern();
+                       String key = r.get(keyIndex).trim().intern();
                        if (key == null)
                                continue;
                        
@@ -86,8 +86,8 @@ public class TechTypeTableData extends ResourceRead<Map<String, Map<String, Stri
                        Iterator<String> v = r.iterator();
                        
                        while (h.hasNext() && v.hasNext()) {
-                               String name = h.next().intern();
-                               String value = v.next();
+                               String name = h.next().trim().intern();
+                               String value = v.next().trim();
                                valueMap.put(name, value);
                        }
                }