Skip to content
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

Problems with constructors and setting with unique construct #1442

Open
TimLethbridge opened this Issue Mar 17, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@TimLethbridge
Copy link
Member

TimLethbridge commented Mar 17, 2019

  1. in the example below, there is an issue with the second constructor
    generated for A. the constructor just assigns aName to name instead of calling
    setName(aName) as is done in the first constructor. because of that, there is
    no check for duplicate names and the hashmap asByName is not properly updated.
class A {
   1 -- 1 B; 
   unique name;
 }
 
 class B {
   anotherName;
 }

Similarly, if a
state machine is defined for A, then the second constructor also does not set
the initial state.

The above was communicated by email from Gunter Mussbacher

  1. there is another issue with the setName(aName) method. assume that an
    instance has "myName" as the value for the name attribute. if setName(aName)
    is called and the same name, i.e., "myName", is passed into it, setName(aName)
    fails, because it detects that "myName" already exists in the hashmap, but
    does not realize that it belongs to the same instance that is being changed.
    this issue occurs for any unique attribute, i.e., it also occurs for a simple
    model with one class and one unique attribute.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.