aboutsummaryrefslogtreecommitdiff
path: root/src/lombok/eclipse/handlers/HandleToString.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/HandleToString.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/HandleToString.java')
-rw-r--r--src/lombok/eclipse/handlers/HandleToString.java8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/lombok/eclipse/handlers/HandleToString.java b/src/lombok/eclipse/handlers/HandleToString.java
index 86f4496d..f2c4e9cf 100644
--- a/src/lombok/eclipse/handlers/HandleToString.java
+++ b/src/lombok/eclipse/handlers/HandleToString.java
@@ -45,7 +45,6 @@ import org.eclipse.jdt.internal.compiler.ast.BinaryExpression;
import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
import org.eclipse.jdt.internal.compiler.ast.Expression;
import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
-import org.eclipse.jdt.internal.compiler.ast.MarkerAnnotation;
import org.eclipse.jdt.internal.compiler.ast.MessageSend;
import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration;
import org.eclipse.jdt.internal.compiler.ast.NameReference;
@@ -226,12 +225,9 @@ public class HandleToString implements EclipseAnnotationHandler<ToString> {
ReturnStatement returnStatement = new ReturnStatement(current, (int)(p >> 32), (int)p);
MethodDeclaration method = new MethodDeclaration(((CompilationUnitDeclaration) type.top().get()).compilationResult);
- method.modifiers = PKG.toModifier(AccessLevel.PUBLIC);
+ method.modifiers = toModifier(AccessLevel.PUBLIC);
method.returnType = new QualifiedTypeReference(TypeConstants.JAVA_LANG_STRING, new long[] {0, 0, 0});
- MarkerAnnotation overrideAnnotation = new MarkerAnnotation(new QualifiedTypeReference(TypeConstants.JAVA_LANG_OVERRIDE, new long[] {p, p, p}), (int)(p >> 32));
- overrideAnnotation.declarationSourceEnd = overrideAnnotation.sourceEnd = overrideAnnotation.statementEnd = (int)p;
- overrideAnnotation.bits |= ASTNode.HasBeenGenerated;
- method.annotations = new Annotation[] {overrideAnnotation};
+ method.annotations = new Annotation[] {makeMarkerAnnotation(TypeConstants.JAVA_LANG_OVERRIDE, p)};
method.arguments = null;
method.selector = "toString".toCharArray();
method.thrownExceptions = null;