uOttawaUniversity of Ottawa - Canadas University
list of dots

Umple User Manual    [Previous]   [Next]   

Loading

W102 Enumeration Causes Method Parameter Ambiguity

Umple semantic warning reported when an enumeration makes a method parameter's type ambiguous. This occurs when there is another class that could also be the parameter's type.

Example

// This example generates the warning because it is ambiguous if "param"
// is an object of class "Y" or the enumeration "Y".

class X {
  enum Y { Red, Blue, Green }
  showY(Y param) { System.out.println(param); }
}

class Y { }

      

Load the above code into UmpleOnline

 

Another Example

// This example does not generate the warning

class X {
  enum Y { Red, Blue, Green }
  showY(Y param) { System.out.println(param); }
}

class Z { }

      

Load the above code into UmpleOnline

 

Another Example

// This example does not generate the warning

enum Z { Red, Blue, Green }

class X {
  showY(Y param) { System.out.println(param); }
}

class Y { }

      

Load the above code into UmpleOnline