Skip to content

Issue #13328: Kill mutation for UnusedLocalVariableCheck 10#13331

Merged
rdiachenko merged 1 commit intocheckstyle:masterfrom
Kevin222004:un
Jul 3, 2023
Merged

Issue #13328: Kill mutation for UnusedLocalVariableCheck 10#13331
rdiachenko merged 1 commit intocheckstyle:masterfrom
Kevin222004:un

Conversation

@Kevin222004
Copy link
Copy Markdown
Contributor

@Kevin222004 Kevin222004 commented Jul 1, 2023

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

Copy link
Copy Markdown
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

instanceAndClassVarStack.forEach(instVar -> {
final VariableDesc variableDesc = new VariableDesc(instVar.getName(),
instVar.getTypeAst(), updatedScope);
null, updatedScope);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please make two params ctor instead

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 1, 2023

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@Kevin222004
Copy link
Copy Markdown
Contributor Author

@romani @rdiachenko @Vyom-Yadav Please merge this pr first before #13151 and #13152

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 1, 2023

Copy link
Copy Markdown
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.

Ok to merge

Comment on lines +878 to +889
/**
* Create a new VariableDesc instance.
*
* @param name name of the variable
* @param scope ast of type {@link TokenTypes#SLIST} or
* {@link TokenTypes#LITERAL_FOR} or {@link TokenTypes#OBJBLOCK}
* which is enclosing the variable
*/
private VariableDesc(String name, DetailAST scope) {
this(name, null, scope);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok for killing the mutation. IMO the check design should be slightly modified not to ask for type if it is an instance variable.

Copy link
Copy Markdown
Member

@Vyom-Yadav Vyom-Yadav left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Member

@rdiachenko rdiachenko left a comment

Choose a reason for hiding this comment

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

lgtm

@rdiachenko rdiachenko merged commit aefce97 into checkstyle:master Jul 3, 2023
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.

4 participants