diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2012-01-19 00:48:54 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2012-01-19 00:48:54 +0100 |
commit | c680b1cfda8e23b5621704eae26997fcfa80560e (patch) | |
tree | fec8c5f0c7dd15f075392aae4dce3127a7b30d1e /src/core | |
parent | 0774cf929ca3746db650563b74bebeab11af19fa (diff) | |
parent | 5185f97cd6dd7697eeca2455897cbad9dea9ed96 (diff) | |
download | lombok-c680b1cfda8e23b5621704eae26997fcfa80560e.tar.gz lombok-c680b1cfda8e23b5621704eae26997fcfa80560e.tar.bz2 lombok-c680b1cfda8e23b5621704eae26997fcfa80560e.zip |
Merge branch 'Issue_325' of https://github.com/jvanderhel/lombok into jappe
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java | 3 | ||||
-rw-r--r-- | src/core/lombok/eclipse/handlers/SetGeneratedByVisitor.java | 11 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java b/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java index d4c63da3..ef01835c 100644 --- a/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java +++ b/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java @@ -222,14 +222,17 @@ public class HandleEqualsAndHashCode extends EclipseAnnotationHandler<EqualsAndH } MethodDeclaration equalsMethod = createEquals(typeNode, nodesForEquality, callSuper, errorNode.get(), fieldAccess, needsCanEqual); + equalsMethod.traverse(new SetGeneratedByVisitor(errorNode.get()), ((TypeDeclaration)typeNode.get()).scope); injectMethod(typeNode, equalsMethod); if (needsCanEqual) { MethodDeclaration canEqualMethod = createCanEqual(typeNode, errorNode.get()); + canEqualMethod.traverse(new SetGeneratedByVisitor(errorNode.get()), ((TypeDeclaration)typeNode.get()).scope); injectMethod(typeNode, canEqualMethod); } MethodDeclaration hashCodeMethod = createHashCode(typeNode, nodesForEquality, callSuper, errorNode.get(), fieldAccess); + hashCodeMethod.traverse(new SetGeneratedByVisitor(errorNode.get()), ((TypeDeclaration)typeNode.get()).scope); injectMethod(typeNode, hashCodeMethod); } diff --git a/src/core/lombok/eclipse/handlers/SetGeneratedByVisitor.java b/src/core/lombok/eclipse/handlers/SetGeneratedByVisitor.java index 13292cdd..7d2b7a74 100644 --- a/src/core/lombok/eclipse/handlers/SetGeneratedByVisitor.java +++ b/src/core/lombok/eclipse/handlers/SetGeneratedByVisitor.java @@ -247,6 +247,13 @@ public final class SetGeneratedByVisitor extends ASTVisitor { node.nameSourcePosition = recalcSourcePosition(node.nameSourcePosition); } + private void applyOffsetQualifiedNameReference(QualifiedNameReference node) { + applyOffsetExpression(node); + for (int i = 0; i < node.sourcePositions.length; i++) { + node.sourcePositions[i] = recalcSourcePosition(node.sourcePositions[i]); + } + } + private void applyOffsetQualifiedTypeReference(QualifiedTypeReference node) { applyOffsetExpression(node); for (int i = 0; i < node.sourcePositions.length; i++) { @@ -787,8 +794,8 @@ public final class SetGeneratedByVisitor extends ASTVisitor { } @Override public boolean visit(QualifiedNameReference node, BlockScope scope) { - setGeneratedBy(node, source); - applyOffsetExpression(node); + setGeneratedBy(node, source); + applyOffsetQualifiedNameReference(node); return super.visit(node, scope); } |