aboutsummaryrefslogtreecommitdiff
path: root/src/lombok/eclipse/handlers/PKG.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@tipit.to>2009-09-01 19:05:21 +0200
committerReinier Zwitserloot <reinier@tipit.to>2009-09-01 19:05:21 +0200
commit25e33d02e3b91b04947257ffa3c6233f1c81d3ce (patch)
tree88b01de8f3d0c24c20febc03ae2476782e3ac1aa /src/lombok/eclipse/handlers/PKG.java
parent5b160554176f7439fba10fe709b948b8310a4fb0 (diff)
downloadlombok-25e33d02e3b91b04947257ffa3c6233f1c81d3ce.tar.gz
lombok-25e33d02e3b91b04947257ffa3c6233f1c81d3ce.tar.bz2
lombok-25e33d02e3b91b04947257ffa3c6233f1c81d3ce.zip
Added position information _everywhere_ in EqualsAndHashCode and ToString generating. This really does seem to fix the David Lynch bug (#41).
Diffstat (limited to 'src/lombok/eclipse/handlers/PKG.java')
-rw-r--r--src/lombok/eclipse/handlers/PKG.java8
1 files changed, 8 insertions, 0 deletions
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;
+ }
}