Skip to content

MINOR; Use underscore for variable initialization in Scala sources #12534

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

Merged

Conversation

mdedetrich
Copy link
Contributor

In Scala its standard practice to use _ whenever you are initializing
variables. In regard to implementation, for object references
_ initialization maps to null so there is no change in behaviour.

This PR is the equivalent of #12471 but for KafkaServer

@mdedetrich
Copy link
Contributor Author

@mimaison Since you reviewed #12471 can you have a look at this PR (once the CI is happy of course)?

@mimaison
Copy link
Member

Thanks for the PR!
I did a quick search and it looks like there are 200+ such instances across 40+ files. If you want to address them all, maybe let's group them in 1 or 2 PRs.

@mdedetrich
Copy link
Contributor Author

Sure thing will do.

@mdedetrich mdedetrich force-pushed the kafkaserver-underscore-initialization branch from 1481dbd to b925ce0 Compare August 18, 2022 19:10
@mdedetrich mdedetrich changed the title MINOR; Use underscore for variable initialization in KafkaServer MINOR; Use underscore for variable initialization in Scala sources Aug 18, 2022
@mdedetrich mdedetrich force-pushed the kafkaserver-underscore-initialization branch from b925ce0 to dd29dce Compare August 18, 2022 19:33
@mdedetrich
Copy link
Contributor Author

@mimaison PR has been updated as you wanted.

In Scala its standard practice to use _ whenever you are initializing
variables. In regard to implementation, for object references
_ initialization maps to null so there is no change in behaviour.
@mdedetrich mdedetrich force-pushed the kafkaserver-underscore-initialization branch from dd29dce to 23cce8b Compare August 23, 2022 12:52
@mdedetrich mdedetrich requested a review from mimaison August 23, 2022 13:07
Copy link
Member

@mimaison mimaison left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM

@mimaison mimaison merged commit 4170e74 into apache:trunk Aug 24, 2022
@mdedetrich mdedetrich deleted the kafkaserver-underscore-initialization branch August 24, 2022 13:33
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