About Question enthuware.ocpjp.v11.2.3393 :
Posted: Thu Jun 02, 2022 2:42 pm
Dear Enthuware,
This question is clear but I still don't understand the answer and I can't find many documentation about this edge case of Repeatable container annotation.
In my opinion it could make sense either if the annotation container is present as follows:
Or the way it should be with the repeated annotation:
What I really don't understand is why is it legal to have a mix with both?
And also in this scenario if I add another @Author annotation it doesn't compile anymore, I really don't understand this behaviour.
In the last example the method myMethod how many @Author annotations has? bob, alice and Charlie? Only bob and alice? Only Charlie?
Thanks in advance for helping me understand this particular behaviour.
Best regards
This question is clear but I still don't understand the answer and I can't find many documentation about this edge case of Repeatable container annotation.
In my opinion it could make sense either if the annotation container is present as follows:
Code: Select all
@Authors(value = {@Author("Bob"), @Author("Alice")} )
Code: Select all
@Author("Bob")
@Author("Alice")
Code: Select all
@Authors(value={@Author("bob"), @Author("alice") })
@Author("Charlie")
void myMethod(){}
In the last example the method myMethod how many @Author annotations has? bob, alice and Charlie? Only bob and alice? Only Charlie?
Thanks in advance for helping me understand this particular behaviour.
Best regards