summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRohit Agrawal2012-08-09 06:29:00 (EDT)
committerRohit Agrawal2012-08-09 06:29:00 (EDT)
commit80c9ca65def943dd032476745e9a52ca42bb889c (patch)
treebe0732e31f0cd6be1eac6d46a03e18728854cb2b
parent1f8643ad8db6f76d085d4f60f7f7f45f3bd77614 (diff)
downloadorg.eclipse.etrice-80c9ca65def943dd032476745e9a52ca42bb889c.zip
org.eclipse.etrice-80c9ca65def943dd032476745e9a52ca42bb889c.tar.gz
org.eclipse.etrice-80c9ca65def943dd032476745e9a52ca42bb889c.tar.bz2
[CQ6589] : Proposal Generator Class with more changes, still unsure whatrefs/changes/55/7155/1
warning cases will be 1. I authored 100% of the content I contributed 2. I have the rights to donate the content to Eclipse 3. I contribute the content under the EPL Change-Id: Ice4586be10880baddb1286c7595f13cf44785b0f
-rw-r--r--plugins/org.eclipse.etrice.abstractexec.behavior/.options1
-rw-r--r--plugins/org.eclipse.etrice.abstractexec.behavior/src/org/eclipse/etrice/abstractexec/behavior/AbstractExecutionValidator.java14
-rw-r--r--plugins/org.eclipse.etrice.abstractexec.behavior/src/org/eclipse/etrice/abstractexec/behavior/ActiveRules.java10
-rw-r--r--plugins/org.eclipse.etrice.abstractexec.behavior/src/org/eclipse/etrice/abstractexec/behavior/ProposalGenerator.java3
4 files changed, 24 insertions, 4 deletions
diff --git a/plugins/org.eclipse.etrice.abstractexec.behavior/.options b/plugins/org.eclipse.etrice.abstractexec.behavior/.options
index c00c227..21d07f7 100644
--- a/plugins/org.eclipse.etrice.abstractexec.behavior/.options
+++ b/plugins/org.eclipse.etrice.abstractexec.behavior/.options
@@ -1 +1,2 @@
+org.eclipse.etrice.abstractexec.behavior/debug=true
org.eclipse.etrice.abstractexec.behavior/trace/proposals=true \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.abstractexec.behavior/src/org/eclipse/etrice/abstractexec/behavior/AbstractExecutionValidator.java b/plugins/org.eclipse.etrice.abstractexec.behavior/src/org/eclipse/etrice/abstractexec/behavior/AbstractExecutionValidator.java
index 0ed4d50..d37edc3 100644
--- a/plugins/org.eclipse.etrice.abstractexec.behavior/src/org/eclipse/etrice/abstractexec/behavior/AbstractExecutionValidator.java
+++ b/plugins/org.eclipse.etrice.abstractexec.behavior/src/org/eclipse/etrice/abstractexec/behavior/AbstractExecutionValidator.java
@@ -73,15 +73,25 @@ public class AbstractExecutionValidator implements IRoomValidator {
System.out.println("Final printing of rules : ");
checker.printRules();
System.out.println("Rule checking for " + xpac.getActorClass().getName() + " is over");
- ProposalGenerator propGen = new ProposalGenerator(xpac,checker);
+
TreeIterator<EObject> it = xpac.getStateMachine().eAllContents();
while(it.hasNext())
{
EObject obj = it.next();
if(obj instanceof State)
{
+ ProposalGenerator propGen = new ProposalGenerator(xpac,checker);
State st = (State) obj;
- propGen.getProposals(st);
+ boolean issueWarning = propGen.getProposals(st);
+ if(issueWarning)
+ {
+ //handle the cases accordingly by retrieving the
+ //warning list once clear what exactly is to be included in warnings
+ }
+ else
+ {
+ //if there are no warnings, then proposals should be generated
+ }
}
}
diff --git a/plugins/org.eclipse.etrice.abstractexec.behavior/src/org/eclipse/etrice/abstractexec/behavior/ActiveRules.java b/plugins/org.eclipse.etrice.abstractexec.behavior/src/org/eclipse/etrice/abstractexec/behavior/ActiveRules.java
index c2fc78e..ea00711 100644
--- a/plugins/org.eclipse.etrice.abstractexec.behavior/src/org/eclipse/etrice/abstractexec/behavior/ActiveRules.java
+++ b/plugins/org.eclipse.etrice.abstractexec.behavior/src/org/eclipse/etrice/abstractexec/behavior/ActiveRules.java
@@ -132,10 +132,16 @@ public class ActiveRules {
//remove the discarded rules now
for(SemanticsRule rule : toRemove)
{
- this.rules.get(msg.getFrom()).remove(rule);
+ if(rules.containsKey(msg.getFrom()))
+ {
+ this.rules.get(msg.getFrom()).remove(rule);
+ }
}
//this basically just adds the advanced rules back to the ruleSet
- this.rules.get(msg.getFrom()).addAll(follow);
+ if(rules.containsKey(msg.getFrom()))
+ {
+ this.rules.get(msg.getFrom()).addAll(follow);
+ }
return follow;
}
public void buildInitLocalRules(ExpandedActorClass xpAct)
diff --git a/plugins/org.eclipse.etrice.abstractexec.behavior/src/org/eclipse/etrice/abstractexec/behavior/ProposalGenerator.java b/plugins/org.eclipse.etrice.abstractexec.behavior/src/org/eclipse/etrice/abstractexec/behavior/ProposalGenerator.java
index 846a73c..13fb5a4 100644
--- a/plugins/org.eclipse.etrice.abstractexec.behavior/src/org/eclipse/etrice/abstractexec/behavior/ProposalGenerator.java
+++ b/plugins/org.eclipse.etrice.abstractexec.behavior/src/org/eclipse/etrice/abstractexec/behavior/ProposalGenerator.java
@@ -66,6 +66,9 @@ public class ProposalGenerator {
{
boolean issueWarning = false;
ActiveRules rules = checker.getActiveRules(st);
+ //in case the state is disconnected component of the graph
+ if(rules==null)
+ return false;
xpac.getActiveTriggers(st);
Set<SemanticsRule> rulesToIgnore = new HashSet<SemanticsRule>();