-
Notifications
You must be signed in to change notification settings - Fork 315
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
Added token position tests for annotations #1960
base: develop
Are you sure you want to change the base?
Conversation
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 move the comment
languages/java/src/main/java/de/jplag/java/TokenGeneratingTreeScanner.java
Outdated
Show resolved
Hide resolved
Quality Gate passed for 'JPlag Plagiarism Detector'Issues Measures |
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.
Looks good.
My initial thoughts on the open points:
Most of the annotation token types seem to be unused. Maybe we should remove them?
Yes, we can do that, probably in a separate PR to also cover #1865.
I guess ANNO_M was supposed to be annotation members. They are currently extracted as Method tokens. Do we want to keep it like that?
During the declaration of the annotation members in the annotation definition? There I would stick to method tokens.
Annotation arguments are currently not extracted at all. Do we want some tokens for that?
We could actually do this. However, ideally, it would only be for mandatory ones. If we do it for optional ones, you can affect the tokens by removing the argument or adding an argument with the same value as the default.
Let me know what you guys think!
Added some token position tests for annotations. The tests currently fail, because I decided on different lengths than the java module currently reports.
The lengths I assume for these test:
-Annotation: from @ to end of annotation name
-Annotation type begin: from the first modifier to the end of the name
All other tokens lengths are the same as in the current implementation
There are also some considerations for the module:
Most of the annotation token types seem to be unused. Maybe we should remove them?
I guess ANNO_M was supposed to be annotation members. They are currently extracted as Method tokens. Do we want to keep it like that?
Annotation arguments are currently not extracted at all. Do we want some tokens for that?