After a UML-to-Java transformation, the enumeration is not fully qualified in an operation's parameter list
In IBM Rational Software Architect, if you have a UML class with operations whose parameters are of different enumeration types that have the same name, the enumeration within the parameter list will not be qualified.
The following steps reproduce the problem:
- Create a Java project and UML model
- Add a package, Package1, two classes, Class1 and Class2, two interfaces, Interface1 and Interface2, and a class diagram to the model
- Draw an interface realization relationship from Class1 to Interface1 and from Class2 to Interface2
- Add two operations, Operation1 and Operation2, and an enumeration, Enumeration1, to Interface1
- Add two enumeration literals, ONE and TWO, to Interface1::Enumeration1
- Add an operation, Operation2, and an enumeration, Enumeration1, to Interface2
- Add two enumeration literals, A and B, to Interface2::Enumeration1
- Add an In parameter, Parameter1, to Interface1::Operation1, Interface1::Operation2, and Interface2::Operation2
- Give Interface1::Operation1::Parameter1, Interface1::Operation2::Parameter1, and Interface2::Operation2::Parameter1 the types, Interface1::Enumeration1, Interface2::Enumeration1, and Interface2::Enumeration1, respectively
- Save the changes and add a UML-to-Java transformation configuration with the model as the source and the project as the target
- Run the transformation and examine the Java code
Expected Result: The signature from Class1::Operation2 reads:
public void Operation2(Package1.Interface2.Enumeration1 Parameter1)
Actual Result: The signature from Class1::Operation reads:
public void Operation2(Enumeration1 Parameter1)
This has been identified as a product defect under APAR PM74254.
Resolving the problem
Contact IBM Rational Client Support to request a testfix.
|Software Development||Rational Software Architect for WebSphere Software||Transformation||Windows||126.96.36.199|