Add nn for conversion of enhanced for loop to foreach#578
Open
inuyasha82 wants to merge 1 commit into
Open
Conversation
merks
requested changes
Jul 13, 2026
merks
left a comment
Contributor
There was a problem hiding this comment.
Some small typos and grammar issues.
I wonder in general if the result performs worse and/or if it's harder to debug? (Maybe I"m too old fashioned!)
| [Carsten Hammer](https://github.com/carstenartur) | ||
| </details> | ||
|
|
||
| With this new quick assist, on a enhanced for-loop like the following: |
Contributor
There was a problem hiding this comment.
Suggested change
| With this new quick assist, on a enhanced for-loop like the following: | |
| With this new quick assist, on an enhanced for-loop like the following: |
| } | ||
| ``` | ||
|
|
||
| if the list item is an Iterable object a new option is added: `Convert Enhanced for loop to forEach`. |
Contributor
There was a problem hiding this comment.
Suggested change
| if the list item is an Iterable object a new option is added: `Convert Enhanced for loop to forEach`. | |
| if the list item is an `Iterable` object, a new option is available: `Convert Enhanced 'for' loop to 'forEach'`. |
The text of the option should look exactly like it does in the IDE, where I think there are ' characters that are missing.
| ``` | ||
|
|
||
| if the list item is an Iterable object a new option is added: `Convert Enhanced for loop to forEach`. | ||
| This let the user to convert the loop above, with a `forEach` statement: |
Contributor
There was a problem hiding this comment.
Suggested change
| This let the user to convert the loop above, with a `forEach` statement: | |
| This converts the loop above, with a `forEach` statement: |
| System.out.println(adj); | ||
| }); | ||
| ``` | ||
| Below an animation of the new quick assist: |
Contributor
There was a problem hiding this comment.
Suggested change
| Below an animation of the new quick assist: | |
| Below is an animation of the new quick assist: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add new n&n news for the new conversion from enhanced loop for to forEach method.
Implements this issue: eclipse-jdt/eclipse.jdt.ui#2934
Relevant pr: eclipse-jdt/eclipse.jdt.ui#3002