diff options
author | 2017-08-17 17:26:52 +0200 | |
---|---|---|
committer | 2017-08-17 17:26:52 +0200 | |
commit | 49023517b9aea7d07bc6525df335e062f70ea242 (patch) | |
tree | f713f279180ecfe0ed37fe2293fc2b44d7e4610d /Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic/src/hu/bme/mit | |
parent | Transitive closure support (diff) | |
download | VIATRA-Generator-49023517b9aea7d07bc6525df335e062f70ea242.tar.gz VIATRA-Generator-49023517b9aea7d07bc6525df335e062f70ea242.tar.zst VIATRA-Generator-49023517b9aea7d07bc6525df335e062f70ea242.zip |
null check before mapping value of a reference
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic/src/hu/bme/mit')
1 files changed, 4 insertions, 4 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretation2logic/InstanceModel2PartialInterpretation.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretation2logic/InstanceModel2PartialInterpretation.xtend index 080ad963..8e5e0661 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretation2logic/InstanceModel2PartialInterpretation.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretation2logic/InstanceModel2PartialInterpretation.xtend | |||
@@ -2,6 +2,8 @@ package hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic | |||
2 | 2 | ||
3 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic | 3 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic |
4 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic_Trace | 4 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic_Trace |
5 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.TracedOutput | ||
6 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.TypeScopes | ||
5 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.DefinedElement | 7 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.DefinedElement |
6 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.LogiclanguageFactory | 8 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.LogiclanguageFactory |
7 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TypeDeclaration | 9 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TypeDeclaration |
@@ -15,11 +17,9 @@ import java.util.List | |||
15 | import java.util.Map | 17 | import java.util.Map |
16 | import org.eclipse.emf.common.util.Enumerator | 18 | import org.eclipse.emf.common.util.Enumerator |
17 | import org.eclipse.emf.ecore.EObject | 19 | import org.eclipse.emf.ecore.EObject |
20 | import org.eclipse.emf.ecore.resource.Resource | ||
18 | 21 | ||
19 | import static extension hu.bme.mit.inf.dslreasoner.util.CollectionsUtil.* | 22 | import static extension hu.bme.mit.inf.dslreasoner.util.CollectionsUtil.* |
20 | import org.eclipse.emf.ecore.resource.Resource | ||
21 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.TracedOutput | ||
22 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.TypeScopes | ||
23 | 23 | ||
24 | class InstanceModel2PartialInterpretation { | 24 | class InstanceModel2PartialInterpretation { |
25 | val extension LogiclanguageFactory factory = LogiclanguageFactory.eINSTANCE | 25 | val extension LogiclanguageFactory factory = LogiclanguageFactory.eINSTANCE |
@@ -87,8 +87,8 @@ class InstanceModel2PartialInterpretation { | |||
87 | } | 87 | } |
88 | } else { | 88 | } else { |
89 | val target = source.eGet(reference) as EObject | 89 | val target = source.eGet(reference) as EObject |
90 | val targetElement = target.lookup(object2DefinedElement) | ||
91 | if(target !== null) { | 90 | if(target !== null) { |
91 | val targetElement = target.lookup(object2DefinedElement) | ||
92 | translateLink(interpretation,sourceElement,targetElement) | 92 | translateLink(interpretation,sourceElement,targetElement) |
93 | } | 93 | } |
94 | } | 94 | } |