-
-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
review fix: fix bug with repeatable annotations #1724
Conversation
This PR intends to fix #1722 but it also fixes cases when trying to annotate twice on an annotation type that does not take an Array: the current behavior was to create an array nevertheless, now it throws a SpoonException. I also had to make a choice when calling repeatedly annotate with a String value on this kind of annotation: @Repeatable(Tags.class)
public @interface Tag {
String[] value();
} We could have indeed those different results: @Tag("value1")
@Tag("value2")
@Tag("value3")
void foo1();
@Tag({"value1", "value2"})
@Tag("value3")
void foo2();
@Tag({"value1", "value2", "value3"})
void foo3(); Previous behaviour did not take into account the My guess is that if the user really wants to put an array of objects in the value, then it can always annotate with the array of objects, instead of calling multiple times annotate. |
I have checked this PR and it looks good for me. I would merge it but the meaning of word "factorized" in the title is not clear for me. So I am just not sure with merge comment ... |
fixed title. ready for merge! |
fix #1722