-
assigned issue to
Prevent creating same operation twice
There should be a check when a) changing an operations name and b) when creating a new operation to ensure that an operation with the same signature doesn't already exist.
Comments (7)
-
-
References issue
#33: Added uniqueness name checking when an attribute is created→ <<cset 331a89c1acf6>>
-
References issue
#33: Moved uniqueness attributes and operations checking in ClassController.java and added attribute in setter operation→ <<cset a3a4ba0a5c24>>
-
Finally, I moved the call to uniqueness checking methods in the ClassController because I think it is more logical to check attributes and operations uniqueness for all added attributes and operations (and not only those which are written from the GUI). In this way, for example it becomes impossible to duplicate getter and setter methods after having tap and hold event on the attribute name.
Moreover, I commented all the createGetterAndSetterOperation() method body in the ClassController, to just call the createGetterOperation() and the createSetterOperation() methods, what it is more logical than rewrite what other methods already do. (And I added the parameter in the creation of setter method from attributes)
-
reporter Finally, I moved the call to uniqueness checking methods in the ClassController because I think it is more logical to check attributes and operations uniqueness for all added attributes and operations (and not only those which are written from the GUI). In this way, for example it becomes impossible to duplicate getter and setter methods after having tap and hold event on the attribute name.
That's a good point. So far we have only done these check in the UI, but you are right. If another UI is used this will be missing. The
IllegalArgumentException
was initially thought for being able to tell the user the reason, but I am not sure if that's the best way. If you have a better idea how this could be done, feel free to tell us :)Moreover, I commented all the createGetterAndSetterOperation() method body in the ClassController, to just call the createGetterOperation() and the createSetterOperation() methods, what it is more logical than rewrite what other methods already do. (And I added the parameter in the creation of setter method from attributes)
The reason why it was separated was that when you press "Create Getter and Setter" and then undo, it will only undo one, so you have to undo twice to actually undo it. But maybe its not really a big problem for the user and it is definitely nicer/cleaner code :) I think you can remove the code you commented out completely, though.
Thanks!
-
reporter - changed milestone to AOSD 2014 Demo
-
reporter - changed status to resolved
Thanks :)
- Log in to comment