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

AMQ-9550 for loop can be replaced with enhanced for connection manager adapter #1282

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

levrun
Copy link

@levrun levrun commented Aug 17, 2024

What problems does this PR solve?

Iteration over collections or arrays  can be replaced with an enhanced for loop (foreach iteration syntax). 
See more details why : https://docs.oracle.com/javase/8/docs/technotes/guides/language/foreach.html

Why is it beneficial to merge into ActiveMQ?

The for-each construct gets rid of the clutter and the opportunity for error.
When should you use the for-each loop? Any time you can. It really beautifies your code.

How do you make sure this PR is well tested?
run tests locally

@kenliao94
Copy link
Contributor

@jbonofre Hey JB, could you take a quick look at this PR? Thanks.

@mattrpav mattrpav self-requested a review October 25, 2024 19:22
@mattrpav
Copy link
Contributor

mattrpav commented Oct 25, 2024

The code change is fine -- I think the ticket description and commit message could be clarified/simplified as this is just a simple modernization and not a fundamental change in loop algorithm.

Something like:
activemq-ra: modernize loops to remove iterator

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