New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Umple doesn't react properly to definition of guards #819

Closed
vahdat-ab opened this Issue Apr 14, 2016 · 3 comments

Comments

Projects
None yet
4 participants
@vahdat-ab
Member

vahdat-ab commented Apr 14, 2016

consider the following example:

class A{
 Boolean repeatCheck = false;
  status {
    s1{
        [repeatCheck()]-> s2;
        [repeatCheck()]-> s3;
    }
    s2{
    }
    s3{
    }
  }

  Boolean repeatCheck() {
    return true;
  }
}

In the generated code, Umple changes the name of repeatCheck to getRepeatCheck() and puts another parantheses (getRepeatCheck()()). Looks look It doesn't recognize the method and consider it as a variable.


  private boolean __autotransition1__()
  {
    boolean wasEventProcessed = false;

    Status aStatus = status;
    switch (aStatus)
    {
      case SENDING:
        if (getRepeatCheck()())
        {
          setStatus(Status.UPDATING);
          wasEventProcessed = true;
          break;
        }
        break;
      default:
        // Other states do respond to this event
    }

    return wasEventProcessed;
  }
@marc22alain

This comment has been minimized.

Contributor

marc22alain commented Sep 24, 2016

This issue appears to be similar to #870. The class definition contains a field and a method with the same name, and the parser gets confused.

@tlaport4 tlaport4 self-assigned this Oct 11, 2016

vahdat-ab added a commit that referenced this issue Nov 25, 2016

@vahdat-ab

This comment has been minimized.

Member

vahdat-ab commented Nov 25, 2016

@tlaport4 Since our last meeting, I worked on this issue and found the solution. I created a branch and committed into it. The branch name is issue819. Please double check that it works and also write comprehensive test cases and then commit them to the branch. Afterward, you can make a PR.
Another test case :-)

class A{
 Boolean repeatCheck = false;
  status {
    s1{
        [repeatCheck < repeatCheck(z)]-> s2;
    }
    s2{
    }
  }
  Boolean repeatCheck() {
    return true;
  }
}

@vahdat-ab vahdat-ab closed this Dec 6, 2016

@vahdat-ab vahdat-ab reopened this Dec 6, 2016

@vahdat-ab

This comment has been minimized.

Member

vahdat-ab commented Dec 6, 2016

This has been fixed by PR928

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment