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

refactor: inline local variable - CtRenameLocalVariableRefactoring.java #2435

Merged
merged 2 commits into from
Sep 3, 2018
Merged

refactor: inline local variable - CtRenameLocalVariableRefactoring.java #2435

merged 2 commits into from
Sep 3, 2018

Conversation

zielint0
Copy link
Contributor

@zielint0 zielint0 commented Sep 1, 2018

@surli
Please review.

This PR is based on #2377
I tried to simplify logic of public ScanningMode enter(CtElement element) without breaking it.

CtElement ele = (CtElement) element;
if (ele.hasParent(ignoredParent)) {
if (ignoredParent != null && element != null) {
if (element.hasParent(ignoredParent)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thank you, it is really better now. Would not it be even easier, if there would be only one if and longer condition?

@zielint0
Copy link
Contributor Author

zielint0 commented Sep 2, 2018

@pvojtechovsky
You are right. I combined 'if's. Thanks! :-)

Copy link
Collaborator

@pvojtechovsky pvojtechovsky left a comment

Choose a reason for hiding this comment

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

Thanks you ;-)

@pvojtechovsky pvojtechovsky merged commit 2a7800f into INRIA:master Sep 3, 2018
@zielint0 zielint0 deleted the refactor-fix-code-inspection-inline-local-variable-CtRenameLocalVariableRefactoring.java branch September 4, 2018 17:57
@monperrus monperrus mentioned this pull request Sep 20, 2018
4 tasks
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.

2 participants