|
W1009 Getter Setter Method Name Conflict
[Previous]  [Next] 
|
![]() |
User Manual [Previous]  [Next] W1009 Getter Setter Method Name ConflictUmple semantic warning reported when a class redefines a getter or setter method on a declared attributeUmple generates a setter and getter for most attributes, and will issue a warning if these methods are redefined. The attempt to redefine the method will be ignored. Developers can either rename the redefined method or else use a before or after statement if they want to add functionality to the getter or setter method. Example
//The getAttr method is already
//generated by the declaration of
//the attribute attr and generates
//the warning
class A {
attr;
getAttr() {/* Implementation */};
}
Load the above code into UmpleOnline Solution to The Above So the Message No Longer Appears
//Modifying the name of the
//method can fix the warning
class A {
attr;
returnAttr() Java {/* Implementation */};
returnAttr() Python {''' Implementation '''};
}
Load the above code into UmpleOnline |