From b512546508a1efbe414b7e11cf9f13b0ed29cbcf Mon Sep 17 00:00:00 2001 From: peichhorn Date: Mon, 30 May 2011 23:44:30 +0200 Subject: The EclipseAST was incomplete when it came to ConstructorCalls. This lead to a severe error in PatchDelegate(issue #211) where classes that didn't use lombok at all could not be build due to a NullPointerException. --- src/core/lombok/eclipse/EclipseAST.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/core/lombok/eclipse/EclipseAST.java b/src/core/lombok/eclipse/EclipseAST.java index 6915fcb4..7c816c50 100644 --- a/src/core/lombok/eclipse/EclipseAST.java +++ b/src/core/lombok/eclipse/EclipseAST.java @@ -35,6 +35,7 @@ import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration; import org.eclipse.jdt.internal.compiler.ast.Annotation; import org.eclipse.jdt.internal.compiler.ast.Argument; import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration; +import org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration; import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration; import org.eclipse.jdt.internal.compiler.ast.ImportReference; import org.eclipse.jdt.internal.compiler.ast.Initializer; @@ -301,6 +302,10 @@ public class EclipseAST extends AST { if (setAndGetAsHandled(method)) return null; List childNodes = new ArrayList(); childNodes.addAll(buildArguments(method.arguments)); + if (method instanceof ConstructorDeclaration) { + ConstructorDeclaration constructor = (ConstructorDeclaration) method; + addIfNotNull(childNodes, buildStatement(constructor.constructorCall)); + } childNodes.addAll(buildStatements(method.statements)); childNodes.addAll(buildAnnotations(method.annotations, false)); return putInMap(new EclipseNode(this, method, childNodes, Kind.METHOD)); -- cgit