From 25e33d02e3b91b04947257ffa3c6233f1c81d3ce Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Tue, 1 Sep 2009 19:05:21 +0200 Subject: Added position information _everywhere_ in EqualsAndHashCode and ToString generating. This really does seem to fix the David Lynch bug (#41). --- src/lombok/eclipse/handlers/PKG.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/lombok/eclipse/handlers/PKG.java') diff --git a/src/lombok/eclipse/handlers/PKG.java b/src/lombok/eclipse/handlers/PKG.java index 8e58c83f..98c60524 100644 --- a/src/lombok/eclipse/handlers/PKG.java +++ b/src/lombok/eclipse/handlers/PKG.java @@ -44,6 +44,7 @@ import org.eclipse.jdt.internal.compiler.ast.EqualExpression; import org.eclipse.jdt.internal.compiler.ast.Expression; import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration; import org.eclipse.jdt.internal.compiler.ast.IfStatement; +import org.eclipse.jdt.internal.compiler.ast.MarkerAnnotation; import org.eclipse.jdt.internal.compiler.ast.NullLiteral; import org.eclipse.jdt.internal.compiler.ast.OperatorIds; import org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference; @@ -265,4 +266,11 @@ class PKG { return new IfStatement(new EqualExpression(new SingleNameReference(variable.name, 0), new NullLiteral(0, 0), OperatorIds.EQUAL_EQUAL), throwStatement, 0, 0); } + + static MarkerAnnotation makeMarkerAnnotation(char[][] name, long pos) { + MarkerAnnotation ann = new MarkerAnnotation(new QualifiedTypeReference(name, new long[] {pos, pos, pos}), (int)(pos >> 32)); + ann.declarationSourceEnd = ann.sourceEnd = ann.statementEnd = (int)pos; + ann.bits |= ASTNode.HasBeenGenerated; + return ann; + } } -- cgit