Skip to content

Allow respecting SuppressWarning when checking for def - #2

Open
demus-nine wants to merge 2 commits into
virtualdogbert:masterfrom
demus-nine:master
Open

Allow respecting SuppressWarning when checking for def#2
demus-nine wants to merge 2 commits into
virtualdogbert:masterfrom
demus-nine:master

Conversation

@demus-nine

Copy link
Copy Markdown

A suggestion to provide for selectively allowing usage of def where it is unavoidable, without having to disable the def checking entirely.

It could also be expanded to only apply in compiledynamic blocks of code.

@@ -156,9 +159,9 @@ class EnterpriseGroovyASTTransformation extends AbstractASTTransformation {
*
* @param parameters an array of parameters to check, for dynamic typing.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I'm not sure this method needs to be changed in this way, but if it does the documentation needs to be updated to refect that.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Well the point is to have the methodNode at hand to be able to check whether there is a@SuppressWarnings annotation on it. The check could also be done before calling the method, but then you could get inconsistent behaviour if the caller doesn't perform the check.
I'll do the docs, but I haven't been able to figure out how to update a PR between forks with new commits except by closing the PR and creating a new one. Do you know how?

}

@Memoized
private static boolean isDefRequiredSurpressed(AnnotatedNode node) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

All the methods you added should have java doc comments, documenting the inputs and outputs.

@demus-nine

Copy link
Copy Markdown
Author

I simplified the code a bit and added the missing javadocs.

@apryamostanov

apryamostanov commented Jul 6, 2020

Copy link
Copy Markdown

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.

3 participants