google-code-export / umple

Automatically exported from code.google.com/p/umple
1 stars 0 forks source link

Warning 54 prior unguarded duplicate event reported incorrectly #576

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
UmpleOnline example TrafficLightsB gives the following warnings. But this seems 
to be incorrect. The algorithm for detecting these must be wrong. This warning 
should only occur when there is another transition in the same state that is 
unguarded with the same name, or in a superstate.

Please check all state machine examples for this.

Warning on line 25 : Transition detectMalfunction will be ignored due to a 
prior unguarded duplicate event. More information (54)
Warning on line 31 : Transition detectMalfunction will be ignored due to a 
prior unguarded duplicate event. More information (54)
Warning on line 37 : Transition detectMalfunction will be ignored due to a 
prior unguarded duplicate event. More information (54)
Warning on line 43 : Transition detectMalfunction will be ignored due to a 
prior unguarded duplicate event. More information (54)
Warning on line 58 : Transition detectMalfunction will be ignored due to a 
prior unguarded duplicate event. More information (54)
Warning on line 64 : Transition detectMalfunction will be ignored due to a 
prior unguarded duplicate event. More information (54)
Warning on line 70 : Transition detectMalfunction will be ignored due to a 
prior unguarded duplicate event. More information (54)
Warning on line 76 : Transition detectMalfunction will be ignored due to a 
prior unguarded duplicate event. More information (54)

Original issue reported on code.google.com by TimothyCLethbridge on 30 May 2014 at 4:49

GoogleCodeExporter commented 9 years ago

Original comment by TimothyCLethbridge on 4 Jun 2014 at 4:01

GoogleCodeExporter commented 9 years ago
Cause:

The issues 575 and 576 are caused by the same problem.

By definition if there is a transition in a state that also has a auto 
transition a warning should be raised since the normal transition is 
unnecessary. This verification is done by the method 
checkStateForDuplicateEvents of UmpleInternalParser_CodeStateMachine.ump file. 
The problem here is that this method defines a auto transition as a transition 
that does not have a guard nor event. Consequently, a timed transition is also 
considered as a auto transition and raises a warning when followed by a 
"normal" transition.

Solution:

Change the auto transition definition to consider not only the existence of a 
guard and a event associated with the transition but also the presence of a 
timer value.

Original comment by PedroAug...@gmail.com on 4 Jun 2014 at 6:35

GoogleCodeExporter commented 9 years ago

Original comment by PedroAug...@gmail.com on 4 Jun 2014 at 6:35

GoogleCodeExporter commented 9 years ago

Original comment by PedroAug...@gmail.com on 5 Jun 2014 at 2:36

Attachments:

GoogleCodeExporter commented 9 years ago
I found a case where this warning still being raised wrongly.

Try the following case:

class X {
  sm {
    s1 {
      sa {
         -> s2.sa;
      }
      sb {
        e1 -> sa;
        e2 -> s2;
      }
    }
    s2 {
      sa {
        e -> sb;
      }
      sb {
        e1 -> sa;
        e2 -> s1;
        sa
        {
        }
      }
    }
  }
}

I am working to fix this bug.

Original comment by PedroAug...@gmail.com on 10 Jul 2014 at 2:49

GoogleCodeExporter commented 9 years ago
Following the patch that fix the case above:

Original comment by PedroAug...@gmail.com on 10 Jul 2014 at 6:28

Attachments:

GoogleCodeExporter commented 9 years ago
The following patch fix the cases where there is a duplicate event before a 
autotransition. On the current version no warning is raised.

Ex:

class X {
  sm {
    s1 
    {
      e -> s3;
      -> s2;
      -> s3;
    }
    s2 {}
    s3 {}
  }
}

Original comment by PedroAug...@gmail.com on 17 Jul 2014 at 7:53

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by TimothyCLethbridge on 5 Aug 2014 at 7:03