aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/eclipse/EclipseAST.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@tipit.to>2009-11-29 19:46:47 +0100
committerReinier Zwitserloot <reinier@tipit.to>2009-11-29 19:46:47 +0100
commit64f47685ca8fee174d87688e8c5d33de4c153c9b (patch)
treeab6c6fcfdbf648801256f78db829808eb1bb965d /src/core/lombok/eclipse/EclipseAST.java
parent96b7c8ed471745366378d5b7cec8890d16532dee (diff)
parenteb1a51588779ca55c9855651f9eefed9459f0874 (diff)
downloadlombok-64f47685ca8fee174d87688e8c5d33de4c153c9b.tar.gz
lombok-64f47685ca8fee174d87688e8c5d33de4c153c9b.tar.bz2
lombok-64f47685ca8fee174d87688e8c5d33de4c153c9b.zip
Merge branch 'master' into netbeans
Diffstat (limited to 'src/core/lombok/eclipse/EclipseAST.java')
-rw-r--r--src/core/lombok/eclipse/EclipseAST.java11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/core/lombok/eclipse/EclipseAST.java b/src/core/lombok/eclipse/EclipseAST.java
index 7f436ddf..7ed83bfe 100644
--- a/src/core/lombok/eclipse/EclipseAST.java
+++ b/src/core/lombok/eclipse/EclipseAST.java
@@ -56,30 +56,25 @@ public class EclipseAST extends AST<EclipseAST, EclipseNode, ASTNode> {
* @param ast The compilation unit, which serves as the top level node in the tree to be built.
*/
public EclipseAST(CompilationUnitDeclaration ast) {
- super(toFileName(ast));
+ super(toFileName(ast), packageDeclaration(ast), imports(ast));
this.compilationUnitDeclaration = ast;
setTop(buildCompilationUnit(ast));
this.completeParse = isComplete(ast);
clearChanged();
}
- /** {@inheritDoc} */
- @Override public String getPackageDeclaration() {
- CompilationUnitDeclaration cud = (CompilationUnitDeclaration) top().get();
+ private static String packageDeclaration(CompilationUnitDeclaration cud) {
ImportReference pkg = cud.currentPackage;
return pkg == null ? null : Eclipse.toQualifiedName(pkg.getImportName());
}
- /** {@inheritDoc} */
- @Override public Collection<String> getImportStatements() {
+ private static Collection<String> imports(CompilationUnitDeclaration cud) {
List<String> imports = new ArrayList<String>();
- CompilationUnitDeclaration cud = (CompilationUnitDeclaration) top().get();
if (cud.imports == null) return imports;
for (ImportReference imp : cud.imports) {
if (imp == null) continue;
imports.add(Eclipse.toQualifiedName(imp.getImportName()));
}
-
return imports;
}