diff options
author | Reinier Zwitserloot <reinier@tipit.to> | 2009-06-25 05:34:01 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@tipit.to> | 2009-06-25 05:34:01 +0200 |
commit | 19fec30bc17fe4923f74df7b007c38497f4ddcd1 (patch) | |
tree | 750e40af680f5e420c959535b39484184d1f4d7b /src/lombok/javac/handlers/PKG.java | |
parent | dec4be37381caaf4e2ec9af301153734088889fd (diff) | |
download | lombok-19fec30bc17fe4923f74df7b007c38497f4ddcd1.tar.gz lombok-19fec30bc17fe4923f74df7b007c38497f4ddcd1.tar.bz2 lombok-19fec30bc17fe4923f74df7b007c38497f4ddcd1.zip |
javac's HandleData now makes equals methods.
Diffstat (limited to 'src/lombok/javac/handlers/PKG.java')
-rw-r--r-- | src/lombok/javac/handlers/PKG.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lombok/javac/handlers/PKG.java b/src/lombok/javac/handlers/PKG.java index 25d1a93e..76bdd527 100644 --- a/src/lombok/javac/handlers/PKG.java +++ b/src/lombok/javac/handlers/PKG.java @@ -4,7 +4,9 @@ import java.lang.reflect.Modifier; import com.sun.tools.javac.code.Flags; import com.sun.tools.javac.tree.JCTree; +import com.sun.tools.javac.tree.TreeMaker; import com.sun.tools.javac.tree.JCTree.JCClassDecl; +import com.sun.tools.javac.tree.JCTree.JCExpression; import com.sun.tools.javac.tree.JCTree.JCMethodDecl; import com.sun.tools.javac.tree.JCTree.JCVariableDecl; import com.sun.tools.javac.util.List; @@ -123,4 +125,16 @@ class PKG { } return out; } + + static JCExpression chainDots(TreeMaker maker, JavacAST.Node node, String... elems) { + assert elems != null; + assert elems.length > 0; + + JCExpression e = maker.Ident(node.toName(elems[0])); + for ( int i = 1 ; i < elems.length ; i++ ) { + e = maker.Select(e, node.toName(elems[i])); + } + + return e; + } } |