diff options
author | Petr Jiricka <petr.jiricka@sun.com> | 2009-12-17 12:56:58 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@tipit.to> | 2009-12-17 12:56:58 +0100 |
commit | 61b054d78784f27be5420474af4ccb047e1668cc (patch) | |
tree | ab600baaacd917c1f03f1581b91164bc68024219 /src/core/lombok/javac | |
parent | 31d7d8ec92314e4e571d95d8a71e1e981004ae29 (diff) | |
download | lombok-61b054d78784f27be5420474af4ccb047e1668cc.tar.gz lombok-61b054d78784f27be5420474af4ccb047e1668cc.tar.bz2 lombok-61b054d78784f27be5420474af4ccb047e1668cc.zip |
Fix to javac handler; it now properly detects single package names, such as "package foo;"
Diffstat (limited to 'src/core/lombok/javac')
-rw-r--r-- | src/core/lombok/javac/JavacAST.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/lombok/javac/JavacAST.java b/src/core/lombok/javac/JavacAST.java index 9cfe7f34..2218b13f 100644 --- a/src/core/lombok/javac/JavacAST.java +++ b/src/core/lombok/javac/JavacAST.java @@ -42,6 +42,7 @@ import com.sun.tools.javac.tree.JCTree.JCClassDecl; import com.sun.tools.javac.tree.JCTree.JCCompilationUnit; import com.sun.tools.javac.tree.JCTree.JCExpression; import com.sun.tools.javac.tree.JCTree.JCFieldAccess; +import com.sun.tools.javac.tree.JCTree.JCIdent; import com.sun.tools.javac.tree.JCTree.JCImport; import com.sun.tools.javac.tree.JCTree.JCMethodDecl; import com.sun.tools.javac.tree.JCTree.JCStatement; @@ -87,7 +88,7 @@ public class JavacAST extends AST<JavacAST, JavacNode, JCTree> { } private static String packageDeclaration(JCCompilationUnit cu) { - return cu.pid instanceof JCFieldAccess ? cu.pid.toString() : null; + return (cu.pid instanceof JCFieldAccess || cu.pid instanceof JCIdent) ? cu.pid.toString() : null; } private static Collection<String> imports(JCCompilationUnit cu) { |