From: Tuukka Lehtonen Date: Mon, 27 Aug 2018 21:21:33 +0000 (+0300) Subject: Avoid unnecessary ElementClass validation work X-Git-Tag: v1.43.0~136^2~399^2 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=bb2be932187c70082a01e12e1f451dd06650a48c;p=simantics%2Fplatform.git Avoid unnecessary ElementClass validation work GraphToDiagramSynchronizer.SubstituteElementClassImpl can safely ignore ElementClass validation checks which speeds loading up a bit for very large diagrams. gitlab #90 Change-Id: I2aa561cbad8de034362a4a298272d3faa8242537 --- diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/GraphToDiagramSynchronizer.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/GraphToDiagramSynchronizer.java index 9be80c34e..2b72b3e0f 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/GraphToDiagramSynchronizer.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/GraphToDiagramSynchronizer.java @@ -762,7 +762,7 @@ public class GraphToDiagramSynchronizer extends AbstractDisposable implements ID else result.add(eh); } - return ElementClass.compile(result).setId(ec.getId()); + return ElementClass.compile(result, false).setId(ec.getId()); } } diff --git a/bundles/org.simantics.g2d/src/org/simantics/g2d/element/ElementClass.java b/bundles/org.simantics.g2d/src/org/simantics/g2d/element/ElementClass.java index aaea7654d..5d6897601 100644 --- a/bundles/org.simantics.g2d/src/org/simantics/g2d/element/ElementClass.java +++ b/bundles/org.simantics.g2d/src/org/simantics/g2d/element/ElementClass.java @@ -93,13 +93,11 @@ public final class ElementClass extends AbstractHandlerClass { */ public static ElementClass compile(Collection contributions) { - assertClassValid(contributions); return new ElementClass(contributions); } public static ElementClass compile(Collection contributions, boolean check) { - if(check) assertClassValid(contributions); return new ElementClass(contributions, check); }