aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/lombok/javac/JavacAST.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/lombok/javac/JavacAST.java b/src/core/lombok/javac/JavacAST.java
index 0e8d03d5..c09120c1 100644
--- a/src/core/lombok/javac/JavacAST.java
+++ b/src/core/lombok/javac/JavacAST.java
@@ -516,11 +516,12 @@ public class JavacAST extends AST<JavacAST, JavacNode, JCTree> {
private JavacNode buildEnhancedForLoop(JCEnhancedForLoop loop) {
if (setAndGetAsHandled(loop)) return null;
-
+
List<JavacNode> childNodes = new ArrayList<JavacNode>();
+ // The order of the child elements is important and must be kept
+ addIfNotNull(childNodes, buildTree(getVarOrRecordPattern(loop), Kind.STATEMENT));
addIfNotNull(childNodes, buildTree(loop.expr, Kind.STATEMENT));
addIfNotNull(childNodes, buildStatement(loop.body));
- addIfNotNull(childNodes, buildTree(getVarOrRecordPattern(loop), Kind.STATEMENT));
return putInMap(new JavacNode(this, loop, childNodes, Kind.STATEMENT));
}