google-code-export / umple

Automatically exported from code.google.com/p/umple
1 stars 0 forks source link

Invesigate: Unused setter method when having optional to mandatory unbound relation #374

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Try the following Umple model in Umple online:
class Test {
  1..* -- 0..1 Relation;
}

class Relation{}

2.Generate the code into its equivalent to Java. You will find a setter method 
for "setRelation" (which is fine). However, at the other class (Test), you will 
notice that this setter method is not used in the method "setTests". Even, it 
uses reflection o set the "Optional" value.

What is the expected output? 
- This seems a bit confusing that we have a setter method that we do not use. 
Whether we remove that setter method (if it is against design), or we better 
use it in the setTests method. Using the reflection method here seems required 
to nullify the "Relation" object directly as the setter method ignores the NULL 
values.

Original issue reported on code.google.com by ahmedvc@gmail.com on 31 Jan 2013 at 12:03

GoogleCodeExporter commented 9 years ago
We should remove reflection in general when not needed. 

Original comment by TimothyCLethbridge on 12 Sep 2013 at 2:52