aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2018-07-13 03:17:46 -0400
committerHenrik Rentz-Reichert2018-07-13 03:18:11 -0400
commitb5c007221654a5367ad8f92f8fd14b786b46ab3b (patch)
treee136f435903eed94801caa63c2b8c82b5befedfc
parentdeef1e20fec7bf830d6ffd639087ec9212ce6bd0 (diff)
downloadorg.eclipse.etrice-b5c007221654a5367ad8f92f8fd14b786b46ab3b.tar.gz
org.eclipse.etrice-b5c007221654a5367ad8f92f8fd14b786b46ab3b.tar.xz
org.eclipse.etrice-b5c007221654a5367ad8f92f8fd14b786b46ab3b.zip
DCUtil clears genModelAccess cache before access
TODO: check performance and maybe introduce improved caching Change-Id: I9c80b013139e5429b1eb77a1885b5f0fe52875a9
-rw-r--r--plugins/org.eclipse.etrice.dctools/src/org/eclipse/etrice/dctools/GenModelAccess.xtend4
-rw-r--r--plugins/org.eclipse.etrice.dctools/src/org/eclipse/etrice/dctools/ast/DCUtil.xtend3
2 files changed, 6 insertions, 1 deletions
diff --git a/plugins/org.eclipse.etrice.dctools/src/org/eclipse/etrice/dctools/GenModelAccess.xtend b/plugins/org.eclipse.etrice.dctools/src/org/eclipse/etrice/dctools/GenModelAccess.xtend
index 340b069b8..2963a6109 100644
--- a/plugins/org.eclipse.etrice.dctools/src/org/eclipse/etrice/dctools/GenModelAccess.xtend
+++ b/plugins/org.eclipse.etrice.dctools/src/org/eclipse/etrice/dctools/GenModelAccess.xtend
@@ -22,6 +22,10 @@ class GenModelAccess {
Map<ModelComponent, GraphContainer> cache = newHashMap
+ def public clearCache() {
+ cache.clear
+ }
+
def public GraphContainer get(ModelComponent mc) {
if(!cache.containsKey(mc)) {
val injector = new RoomStandaloneSetup().createInjector
diff --git a/plugins/org.eclipse.etrice.dctools/src/org/eclipse/etrice/dctools/ast/DCUtil.xtend b/plugins/org.eclipse.etrice.dctools/src/org/eclipse/etrice/dctools/ast/DCUtil.xtend
index e2f580939..8fd1e21aa 100644
--- a/plugins/org.eclipse.etrice.dctools/src/org/eclipse/etrice/dctools/ast/DCUtil.xtend
+++ b/plugins/org.eclipse.etrice.dctools/src/org/eclipse/etrice/dctools/ast/DCUtil.xtend
@@ -46,8 +46,8 @@ class DCUtil {
@Inject RoomValueConverterService converterService
@Inject DCProposalConfig proposalConfig
+ @Inject GenModelAccess genModelAccess
- val genModelAccess = new GenModelAccess
DCLanguage language = DCLanguage.C_LANGUAGE
new() {
@@ -88,6 +88,7 @@ class DCUtil {
if (transition!==null) {
val roomClass = EcoreUtil2.getContainerOfType(dc, RoomClass)
if (roomClass instanceof ActorClass) {
+ genModelAccess.clearCache
val gc = genModelAccess.get(roomClass)
val link = FsmGenExtensions.getLinkFor(gc, transition)
if (link!==null) {