|
E097 Enumeration and State Machine Conflict
[Previous]  [Next] 
|
![]() |
User Manual [Previous]  [Next] E097 Enumeration and State Machine ConflictUmple semantic error reported when an enumeration, and a state machine within the same class have the same name.In Umple, enumerations and state machines within the same class cannot have the same name. Example
// This example generates the error
// because enumeration "Y" has the
// same name as state machine "Y"
class X {
enum Y { Red, Blue, Green }
Y {
s1 {
goToS2 -> s2;
}
s2 { }
}
}
Load the above code into UmpleOnline Another Example
// This example generates the error
// because enumeration "Y" will be
// added to class "X" since the "attr"
// parameter of "showY" is "Y".
enum Y { Red, Blue, Green }
class X {
showY(Y attr) {
System.out.println(attr); }
Y {
s1 {}
}
}
Load the above code into UmpleOnline Solution to The Above So the Message No Longer Appears
// This example does not generate the error
class X {
enum Y { Red, Blue, Green }
Z {
s1 {
goToS2 -> s2;
}
s2 { }
}
}
Load the above code into UmpleOnline |