From 6c215230360024f9fc1ff6eaa50b180758b8fecb Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Mon, 2 Apr 2018 23:54:03 +0300 Subject: [PATCH] Fail-safe import can now be disabled with a system property Use the system property -Dorg.simantics.tg.import.failOnMissingEntities@ to disable fail-safe import by settings its value to true. refs #7850 Change-Id: I2c29d1795ba0c04b16be1798c237651556326bd9 (cherry picked from commit f7c2f46c7c411c5c9dd3323d3cec3a4b8b6a3bbe) --- .../db/StreamingTransferableGraphImportProcess.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bundles/org.simantics.graph.db/src/org/simantics/graph/db/StreamingTransferableGraphImportProcess.java b/bundles/org.simantics.graph.db/src/org/simantics/graph/db/StreamingTransferableGraphImportProcess.java index c9b48b325..6d3f7e48e 100644 --- a/bundles/org.simantics.graph.db/src/org/simantics/graph/db/StreamingTransferableGraphImportProcess.java +++ b/bundles/org.simantics.graph.db/src/org/simantics/graph/db/StreamingTransferableGraphImportProcess.java @@ -244,9 +244,16 @@ public class StreamingTransferableGraphImportProcess implements TransferableGrap handles[identity.resource] = builder.handle(graph.syncRequest(new UnescapedChildMapOfResource(parent)).get(def.name)); } } - - //if(!missingExternals.isEmpty()) throw new MissingDependencyException(this); - + + if (!missingExternals.isEmpty() && failOnMissingEntities()) + throw new MissingDependencyException(this); + } + + private boolean failOnMissingEntities() { + return "true".equalsIgnoreCase( + System.getProperty( + "org.simantics.tg.import.failOnMissingEntities", + "false") ); } @Override -- 2.47.1