-
-
Notifications
You must be signed in to change notification settings - Fork 346
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: contract CtAnnotation and array of values #1935
Conversation
This reverts commit 78a176f.
* Name of searched value. | ||
* @return the value expression or null if not found. | ||
*/ | ||
@PropertyGetter(role = VALUE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add @Derived
to this method... otherwise the metamodel based code will be confused.
CtArrayTypeReference typeReference2 = this.getFactory().createArrayTypeReference(); | ||
typeReference2.setComponentType(ctExpression.getType().clone()); | ||
newArray.setType(typeReference); | ||
newArray.addElement(ctExpression); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newArray.addElement(ctExpression.clone());
clone is missing
|
||
if (ctExpression instanceof CtLiteral) { | ||
CtTypeReference typeReference = this.getAnnotationType(); | ||
CtType type = typeReference.getDeclaration(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use getTypeDeclaration?
I have a doubt about the name Does this method always return a CtNewArray? |
only if it respects some conditions (it's the only CtLiteral value and the annotation should return an array) else it returns the same value as |
what about getWrappedValue?
|
API changes: 1 (Detected by Revapi) Old API: fr.inria.gforge.spoon:spoon-core:jar:6.3.0-20180404.073823-36 / New API: fr.inria.gforge.spoon:spoon-core:jar:6.3.0-SNAPSHOT
|
Thanks Simon! |
This PR intends to fix the contract defined after discussion in #1928