diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2010-07-28 19:06:46 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2010-07-28 19:06:46 +0200 |
commit | 357fd954e535943a79224c851784e22b6e3b4c90 (patch) | |
tree | 07173c86be3120c605dafea02df7b611cb72a91a /src/core/lombok/javac/handlers/HandleGetter.java | |
parent | 83b4dd86136cad95026f1f2543732e0e39ed6676 (diff) | |
download | lombok-357fd954e535943a79224c851784e22b6e3b4c90.tar.gz lombok-357fd954e535943a79224c851784e22b6e3b4c90.tar.bz2 lombok-357fd954e535943a79224c851784e22b6e3b4c90.zip |
Fix for issue #136: @Getter and @Setter now work on static fields again.
Diffstat (limited to 'src/core/lombok/javac/handlers/HandleGetter.java')
-rw-r--r-- | src/core/lombok/javac/handlers/HandleGetter.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/core/lombok/javac/handlers/HandleGetter.java b/src/core/lombok/javac/handlers/HandleGetter.java index 28402346..ac3a16a1 100644 --- a/src/core/lombok/javac/handlers/HandleGetter.java +++ b/src/core/lombok/javac/handlers/HandleGetter.java @@ -42,7 +42,6 @@ import com.sun.tools.javac.tree.JCTree.JCAnnotation; import com.sun.tools.javac.tree.JCTree.JCBlock; import com.sun.tools.javac.tree.JCTree.JCClassDecl; import com.sun.tools.javac.tree.JCTree.JCExpression; -import com.sun.tools.javac.tree.JCTree.JCFieldAccess; import com.sun.tools.javac.tree.JCTree.JCMethodDecl; import com.sun.tools.javac.tree.JCTree.JCStatement; import com.sun.tools.javac.tree.JCTree.JCTypeParameter; @@ -186,8 +185,8 @@ public class HandleGetter implements JavacAnnotationHandler<Getter> { private JCMethodDecl createGetter(long access, JavacNode field, TreeMaker treeMaker) { JCVariableDecl fieldNode = (JCVariableDecl) field.get(); - JCFieldAccess thisX = treeMaker.Select(treeMaker.Ident(field.toName("this")), fieldNode.name); - JCStatement returnStatement = treeMaker.Return(thisX); + JCExpression fieldRef = createFieldAccessor(treeMaker, field, true); + JCStatement returnStatement = treeMaker.Return(fieldRef); JCBlock methodBody = treeMaker.Block(0, List.of(returnStatement)); Name methodName = field.toName(toGetterName(fieldNode)); |