From: Tuukka Lehtonen Date: Mon, 27 Aug 2018 21:21:33 +0000 (+0300) Subject: Avoid unnecessary ElementClass validation work X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=02000c4f6ecbfb41993d3b9424d0bb144dac7fa3;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 (cherry picked from commit bb2be932187c70082a01e12e1f451dd06650a48c) --- 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 dd6c9b7d1..fa4a280ce 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); }