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

User Manual    [Previous]   [Next]   

W103 Enumeration Causes Event Parameter Ambiguity

Umple semantic warning reported when an enumeration makes an event 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 "goToS2" has "param" which could be
// either an object of class "Y"
// or the enumeration "Y"

class X {
  enum Y { Red, Blue, Green }
  sm {
    s1 {
      goToS2(Y param) /{
        System.out.println(param); } -> s2;
    }
    s2 {}
  }
}

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 }
  sm {
    s1 {
      goToS2(Y param) /
        { System.out.println(param); } -> s2;
    }
    s2 {}
  }
}

class Z { }
      

Load the above code into UmpleOnline