activemq
activemq copied to clipboard
AMQ-9550 for loop can be replaced with enhanced for connection manager adapter
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
@jbonofre Hey JB, could you take a quick look at this PR? Thanks.
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
@mattrpav Good call out.