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

User Manual    [Previous]   [Next]   

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

 

Solution to The Above So the Message No Longer Appears

// 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

 

Solution to The Above So the Message No Longer Appears

// 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