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

Code polish: replace classic for-loop with enhanced #177

Closed
wants to merge 1 commit into from

Conversation

govi20
Copy link
Contributor

@govi20 govi20 commented Jul 7, 2019

ApplicationContext has classic-for loops, these for loops can be replaced with enhanced for-loop to improve code readability.

@ChristopherSchultz
Copy link
Contributor

The patch is smaller is you don't replace listener with servletContextAttributeListener everywhere. Any reason to re-name this local variable reference?

@govi20
Copy link
Contributor Author

govi20 commented Jul 7, 2019

Yes. for-loop's temp variable and ServletContextAttributeListener's old var name were clashing. I don't think using tempListener in a for-loop declaration would be a good idea.

for (Object listener : listeners) listener fits here semantically hence I have renamed other variables

@markt-asf
Copy link
Contributor

for (Object obj : listeners) {... results in a cleaner patch. I've applied that version to master and will back-port shortly. I've also applied some other clean-up and will back-port that too.

@govi20
Copy link
Contributor Author

govi20 commented Jul 8, 2019

Cool Thanks!

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