diff options
author | 2019-02-16 16:59:35 +0100 | |
---|---|---|
committer | 2019-02-19 19:18:25 +0100 | |
commit | d3ff0e28b79ea270171f5e29510f1d2d8d23b5fd (patch) | |
tree | 2661a544fb604a4a3428f3cfe159a6eb48a87b3d /Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf | |
parent | Two-valued fault tree analyzer WIP (diff) | |
download | VIATRA-Generator-d3ff0e28b79ea270171f5e29510f1d2d8d23b5fd.tar.gz VIATRA-Generator-d3ff0e28b79ea270171f5e29510f1d2d8d23b5fd.tar.zst VIATRA-Generator-d3ff0e28b79ea270171f5e29510f1d2d8d23b5fd.zip |
Fix recursive use of computeIfAbsent
Diffstat (limited to 'Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf')
3 files changed, 20 insertions, 9 deletions
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.Cft2FtTransformation.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.Cft2FtTransformation.xtendbin index 20f1f4a7..226e6227 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.Cft2FtTransformation.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.Cft2FtTransformation.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.EventMaterializer.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.EventMaterializer.xtendbin index 271c9cc0..175ae3f1 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.EventMaterializer.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/.EventMaterializer.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/EventMaterializer.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/EventMaterializer.java index 70481341..ac1fc209 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/EventMaterializer.java +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/cft2ft/EventMaterializer.java | |||
@@ -25,7 +25,6 @@ import hu.bme.mit.inf.dslreasoner.faulttree.model.ft.RandomEvent; | |||
25 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.cft2ft.EventCollection; | 25 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.cft2ft.EventCollection; |
26 | import java.util.LinkedHashSet; | 26 | import java.util.LinkedHashSet; |
27 | import java.util.Map; | 27 | import java.util.Map; |
28 | import java.util.function.Function; | ||
29 | import org.eclipse.emf.common.util.EList; | 28 | import org.eclipse.emf.common.util.EList; |
30 | import org.eclipse.emf.ecore.util.EcoreUtil; | 29 | import org.eclipse.emf.ecore.util.EcoreUtil; |
31 | import org.eclipse.xtend.lib.annotations.Data; | 30 | import org.eclipse.xtend.lib.annotations.Data; |
@@ -145,10 +144,16 @@ public class EventMaterializer { | |||
145 | this.pushEventKey(eventKey); | 144 | this.pushEventKey(eventKey); |
146 | Event _xtrycatchfinallyexpression = null; | 145 | Event _xtrycatchfinallyexpression = null; |
147 | try { | 146 | try { |
148 | final Function<EventMaterializer.EventKey<EventDeclaration>, Event> _function = (EventMaterializer.EventKey<EventDeclaration> it) -> { | 147 | Event _xblockexpression_1 = null; |
149 | return this.materialize(it.component, it.event); | 148 | { |
150 | }; | 149 | Event event = this.materializationCache.get(eventKey); |
151 | _xtrycatchfinallyexpression = this.materializationCache.computeIfAbsent(eventKey, _function); | 150 | if ((event == null)) { |
151 | event = this.materialize(component, eventDeclaration); | ||
152 | this.materializationCache.put(eventKey, event); | ||
153 | } | ||
154 | _xblockexpression_1 = event; | ||
155 | } | ||
156 | _xtrycatchfinallyexpression = _xblockexpression_1; | ||
152 | } finally { | 157 | } finally { |
153 | this.popEventKey(eventKey); | 158 | this.popEventKey(eventKey); |
154 | } | 159 | } |
@@ -386,10 +391,16 @@ public class EventMaterializer { | |||
386 | this.pushEventKey(inputKey); | 391 | this.pushEventKey(inputKey); |
387 | EventCollection _xtrycatchfinallyexpression = null; | 392 | EventCollection _xtrycatchfinallyexpression = null; |
388 | try { | 393 | try { |
389 | final Function<EventMaterializer.EventKey<InputEvent>, EventCollection> _function = (EventMaterializer.EventKey<InputEvent> it) -> { | 394 | EventCollection _xblockexpression_1 = null; |
390 | return this.materializeConnectedEvents(it.component, it.event); | 395 | { |
391 | }; | 396 | EventCollection eventCollection = this.multipleInputCache.get(inputKey); |
392 | _xtrycatchfinallyexpression = this.multipleInputCache.computeIfAbsent(inputKey, _function); | 397 | if ((eventCollection == null)) { |
398 | eventCollection = this.materializeConnectedEvents(component, inputEvent); | ||
399 | this.multipleInputCache.put(inputKey, eventCollection); | ||
400 | } | ||
401 | _xblockexpression_1 = eventCollection; | ||
402 | } | ||
403 | _xtrycatchfinallyexpression = _xblockexpression_1; | ||
393 | } finally { | 404 | } finally { |
394 | this.popEventKey(inputKey); | 405 | this.popEventKey(inputKey); |
395 | } | 406 | } |