-
-
Notifications
You must be signed in to change notification settings - Fork 351
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
feat(shadow): Build shadow element from class object. #569
Conversation
Assert.assertEquals(2,annot.names().length); | ||
Assert.assertEquals("foo",annot.names()[0]); | ||
Assert.assertEquals("bar",annot.names()[1]); | ||
final CtAnnotation<SampleAnnotation> annotation = type.getAnnotation(type.getFactory().Annotation().createReference(SampleAnnotation.class)); |
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.
do this change the return type of getAnnotation? is it backward compatible?
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.
There are two methods named getAnnotation(...)
:
getAnnotation(Class<Annotation>)
which returns anAnnotation
.getAnnotation(CtTypeReference)
which returns anCtAnnotation<Annotation>
.
looks nice! we have to find a good name for JScanner and add some API documentation. also, we should add some documentation about this. |
* Returns a subtype {@link CtExecutable} that corresponds to the reference | ||
* even if its declaring type isn't in the Spoon source path. | ||
* | ||
* @return the executable declaration correspond to the reference. |
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.
Typo: correspond -> that corresponds
* | ||
* @return true if the element is a shadow element, otherwise false. | ||
*/ | ||
boolean isShadow(); |
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.
Move to CtShadowable
new feature: add documentation page |
For me:
|
new CtScanner() { | ||
@Override | ||
public void scan(CtElement element) { | ||
if (element != null && element.getClass().isAssignableFrom(CtShadowable.class)) { |
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.
should it be
CtShadowable.class.isAssignableFrom(element.getClass())
?
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.
Good point.
No description provided.