list of dots Digital Research Alliance of Canada logo  NSERC logo  University of Ottawa logo / UniversitĂ© d'Ottawa

User Manual    [Previous]   [Next]   

W1009 Getter Setter Method Name Conflict

Umple semantic warning reported when a class redefines a getter or setter method on a declared attribute

Umple 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() {/* Implementation */};
}
      

Load the above code into UmpleOnline