]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
ListUtils.create(WriteGraph, Iterable<Resource> elements) 64/1264/1
authorMarko Luukkainen <marko.luukkainen@vtt.fi>
Mon, 27 Nov 2017 09:03:22 +0000 (11:03 +0200)
committerMarko Luukkainen <marko.luukkainen@vtt.fi>
Mon, 27 Nov 2017 09:03:22 +0000 (11:03 +0200)
DelayedWritegraph fix

fixes #7645

Change-Id: I699de77f346528234c7007639b01bcdbd72d4de4

bundles/org.simantics.db.common/src/org/simantics/db/common/utils/ListUtils.java

index 3631de4b38b7110c74f2bb0fab91796d9862d99c..a197de88013dec935b1a46c3fb680c5fdf1831e9 100644 (file)
@@ -54,13 +54,8 @@ public class ListUtils {
      * Creates a list containing the given {@code elements}.
      */
     public static Resource create(WriteGraph g, Iterable<Resource> elements) throws DatabaseException {
-        Layer0 L0 = Layer0.getInstance(g);
-        
-        Resource list = g.newResource();
-        g.claim(list, L0.InstanceOf, L0.List);
-        
-        insertBetween(g, L0, list, list, list, elements);
-        return list;
+       Layer0 L0 = Layer0.getInstance(g);
+       return ListUtils.create(g,L0.List, L0.List_ElementWithInverse, L0.List_ElementWithInverse_Inverse, elements);
     }
 
     /**