[java-decompiler] IDEA-346312 adapt patches

- add javadocs

GitOrigin-RevId: 7590d2a966fee3c85ada06a8734ca639db39deec
This commit is contained in:
Mikhail Pyltsin
2024-10-09 23:09:02 +02:00
committed by intellij-monorepo-bot
parent 893d54aab6
commit d8acad81dc

View File

@@ -510,6 +510,12 @@ public final class MergeHelper {
return false;
}
/**
* Attempts to convert a traditional for loop (and do while) into a foreach loop if the conditions are met.
* Tries to find `next` and `hasNext` method and check usual patterns
*
* @return true if the for loop is successfully converted into a foreach loop, false otherwise.
*/
private static boolean tryConvertForEach(@Nullable AssignmentExprent @NotNull [] initExprents,
@NotNull DoStatement stat,
@NotNull AssignmentExprent firstDoExprent,