W102 Enumeration Causes Method Parameter Ambiguity
[Previous]  [Next] 
|
User Manual [Previous]  [Next] W102 Enumeration Causes Method Parameter AmbiguityUmple 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 |