Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2012-09-05 03:37:11 -0400
committerHenrik Rentz-Reichert2012-09-05 03:44:26 -0400
commit64a95e860ae618fda980c3c0ae0123d3e24fd3cb (patch)
treee5dea585589d2ea6860ef2b65900558067a2b604
parent4aad9337e1c9d010d8b9d348d1bee6e8d4eba828 (diff)
downloadorg.eclipse.etrice-64a95e860ae618fda980c3c0ae0123d3e24fd3cb.tar.gz
org.eclipse.etrice-64a95e860ae618fda980c3c0ae0123d3e24fd3cb.tar.xz
org.eclipse.etrice-64a95e860ae618fda980c3c0ae0123d3e24fd3cb.zip
[generator] bug fix: null pointer check in leaf state list
-rw-r--r--plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/generic/RoomExtensions.xtend7
-rw-r--r--plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/RoomExtensions.java11
2 files changed, 11 insertions, 7 deletions
diff --git a/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/generic/RoomExtensions.xtend b/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/generic/RoomExtensions.xtend
index ae3ff2919..08b4c2bd3 100644
--- a/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/generic/RoomExtensions.xtend
+++ b/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/generic/RoomExtensions.xtend
@@ -359,9 +359,10 @@ class RoomExtensions {
def List<State> getLeafStateList(StateGraph sg) {
var ArrayList<State> res = new ArrayList<State>()
- for (s : sg.states) {
- res.addAll(s.leafStateList)
- }
+ if (sg!=null)
+ for (s : sg.states) {
+ res.addAll(s.leafStateList)
+ }
return res
}
diff --git a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/RoomExtensions.java b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/RoomExtensions.java
index 4c863e418..055bfe44e 100644
--- a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/RoomExtensions.java
+++ b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/RoomExtensions.java
@@ -524,10 +524,13 @@ public class RoomExtensions {
public List<State> getLeafStateList(final StateGraph sg) {
ArrayList<State> _arrayList = new ArrayList<State>();
ArrayList<State> res = _arrayList;
- EList<State> _states = sg.getStates();
- for (final State s : _states) {
- List<State> _leafStateList = this.getLeafStateList(s);
- res.addAll(_leafStateList);
+ boolean _notEquals = (!Objects.equal(sg, null));
+ if (_notEquals) {
+ EList<State> _states = sg.getStates();
+ for (final State s : _states) {
+ List<State> _leafStateList = this.getLeafStateList(s);
+ res.addAll(_leafStateList);
+ }
}
return res;
}

Back to the top