google-code-export / umple

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

States being ignored when a SM has more than one definition block #580

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The following code has an error: the two s1 blocks are the same SM, and so s1 
should have three substates, but only has two. s1c is ignored.

class X {
  sm {
    s1 {
      s1a {}
      s1b {}
    }
    s1 {
      s1c {}
    }
  }
}

Original issue reported on code.google.com by PedroAug...@gmail.com on 3 Jun 2014 at 2:46

GoogleCodeExporter commented 9 years ago
Cause: When method "analyzeState" from the 
UmpleInternalParser_CodeStateMachine.ump detects a new definition block of 
sub-states it creates a new SM instance to represent this block. However, if 
the state already has a nestedSM, every try to replace the first definition 
will be unsuccessful. Consequently, only the first definition will be 
considered.

Solution: When adding a new sub-state, the method analyzeState will only create 
a new NestedSM when the parent state does not have one. If there is a SM in 
this state the new information about the sub-state will be included to that 
existent one.

Original comment by PedroAug...@gmail.com on 3 Jun 2014 at 4:34

GoogleCodeExporter commented 9 years ago
Issue solved with revision 4131. Attached can be found the related patch and 
the issue summary.

Original comment by PedroAug...@gmail.com on 4 Jun 2014 at 3:03

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by TimothyCLethbridge on 4 Jun 2014 at 3:59