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

User Manual    [Previous]   [Next]   

E095 Duplicate Enumerations

Umple semantic error reported when duplicate enumerations are detected

In Umple, enumerations must have unique names.

Example

// This example causes the error
enum Month {x,y,z}
enum Month {o,p,q}

class A{
  Month m;
  Month p;
}
      

Load the above code into UmpleOnline

 

Another Example

// This example causes the error

class A{
  enum Month {x,y,z}
  enum Month {o,p,q}
}
      

Load the above code into UmpleOnline

 

Solution to The Above So the Message No Longer Appears

// This example does not cause the error.
// The enumeration within the class
// is prioritized over the enumeration
// defined outside of the class

enum Month {x,y,z}

class A{
  enum Month {o,p,q}
  Month m;
  Month p;
}
      

Load the above code into UmpleOnline