From 19fec30bc17fe4923f74df7b007c38497f4ddcd1 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Thu, 25 Jun 2009 05:34:01 +0200 Subject: javac's HandleData now makes equals methods. --- src/lombok/javac/handlers/PKG.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/lombok/javac/handlers/PKG.java') 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; + } } -- cgit