Skip to content
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

Issue #6440: AnnotationLocation: named parameters must be considered parameters #6444

Merged
merged 1 commit into from Feb 23, 2019

Conversation

pbludov
Copy link
Member

@pbludov pbludov commented Feb 20, 2019

Issue #6440

Regression report: https://pbludov.github.io/issue-6440/

@romani
Copy link
Member

romani commented Feb 21, 2019

Strange that no changes in Google's it.
Please drop there some code there to have warn.

Report is good, code changes are good.

@pbludov
Copy link
Member Author

pbludov commented Feb 21, 2019

Please drop there some code there to have warn.

done

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Items to improve:

* allowSamelineSingleParameterlessAnnotation = false
* allowSamelineParameterizedAnnotation = false
* allowSamelineMultipleAnnotations = true
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have some warnings in this file ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. with allowSamelineMultipleAnnotations = true both allowSamelineSingleParameterlessAnnotation and allowSamelineParameterizedAnnotation has no effect. Actually, this means that any combination of annotations is allowed.

However, it is possible to catch a violation by using annotations on different lines.
This one: https://github.com/checkstyle/checkstyle/blob/master/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationLocationCheck.java#L292
But this is a different case and should be covered by another set of tests.

@romani romani merged commit 96385e2 into checkstyle:master Feb 23, 2019
@pbludov pbludov deleted the issue-6440 branch February 24, 2019 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants