uOttawaUniversity of Ottawa - Canadas University
list of dots

Umple User Manual    [Previous]   [Next]   

Loading

W047 Empty Key Statement

Umple semantic warning reported when a key statement has no elements inside of it

An empty key statement has no meaning, but Umple will detect the key statement and generate methods associated with having a key. This might lead the developer to think that they have defined a key when in fact the generated methods cannot differentiate between instances of the class in question. The warning is shown to notify the developer of the potential mistake.

Example

// This example generates the message
class A {
  id;
  key { }
}


      

Load the above code into UmpleOnline

 

Another Example

// The following shows how to avoid the message.
class A {
  id;
  key { id }
}


      

Load the above code into UmpleOnline