diff options
author | peichhorn <peichhor@web.de> | 2011-05-30 23:44:30 +0200 |
---|---|---|
committer | peichhorn <peichhor@web.de> | 2011-05-30 23:44:30 +0200 |
commit | b512546508a1efbe414b7e11cf9f13b0ed29cbcf (patch) | |
tree | fb7b2d3b12709d92783bc8fe57bdc0e0eaafa722 /src/core | |
parent | 88f4e2d2e3e7e79c5a39ffb73028a330a27f0765 (diff) | |
download | lombok-b512546508a1efbe414b7e11cf9f13b0ed29cbcf.tar.gz lombok-b512546508a1efbe414b7e11cf9f13b0ed29cbcf.tar.bz2 lombok-b512546508a1efbe414b7e11cf9f13b0ed29cbcf.zip |
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.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/lombok/eclipse/EclipseAST.java | 5 |
1 files changed, 5 insertions, 0 deletions
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<EclipseAST, EclipseNode, ASTNode> { if (setAndGetAsHandled(method)) return null; List<EclipseNode> childNodes = new ArrayList<EclipseNode>(); 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)); |