diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2014-01-18 20:22:56 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2014-01-18 20:22:56 +0100 |
commit | 3a7c19f786cb793f40136d80be755ea43f85e852 (patch) | |
tree | 64aebbeeb6b7fad05959b3cd26e52d3a48f310fc /src/core/lombok/eclipse | |
parent | c65ec9694305c8b577e36be64a8a60675251ef92 (diff) | |
download | lombok-3a7c19f786cb793f40136d80be755ea43f85e852.tar.gz lombok-3a7c19f786cb793f40136d80be755ea43f85e852.tar.bz2 lombok-3a7c19f786cb793f40136d80be755ea43f85e852.zip |
[configuration] [snippet] Removed the 'getProject' method; this doesn't even exist on ECJ.
Diffstat (limited to 'src/core/lombok/eclipse')
-rw-r--r-- | src/core/lombok/eclipse/EclipseAST.java | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/src/core/lombok/eclipse/EclipseAST.java b/src/core/lombok/eclipse/EclipseAST.java index 14d5726a..2e11d5e1 100644 --- a/src/core/lombok/eclipse/EclipseAST.java +++ b/src/core/lombok/eclipse/EclipseAST.java @@ -28,17 +28,13 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import lombok.Lombok; import lombok.core.AST; import lombok.core.LombokImmutableList; -import org.eclipse.core.internal.resources.Project; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.Path; -import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.internal.compiler.CompilationResult; import org.eclipse.jdt.internal.compiler.ast.ASTNode; import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration; @@ -52,8 +48,6 @@ import org.eclipse.jdt.internal.compiler.ast.Initializer; import org.eclipse.jdt.internal.compiler.ast.LocalDeclaration; import org.eclipse.jdt.internal.compiler.ast.Statement; import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; -import org.eclipse.jdt.internal.core.JavaElement; -import org.eclipse.jdt.internal.core.JavaProject; /** * Wraps around Eclipse's internal AST view to add useful features as well as the ability to visit parents from children, @@ -190,37 +184,6 @@ public class EclipseAST extends AST<EclipseAST, EclipseNode, ASTNode> { return ast.compilationResult.fileName == null ? null : new String(ast.compilationResult.fileName); } - private static final Pattern PROJECT_NAME_FROM_FILEPATH = Pattern.compile("^/([^/]+)/(.*)$"); - - /** - * Returns the JavaProject object (eclipse's abstraction of the project) associated with the source file that is represented by this AST. - */ - public JavaProject getProject() { - CompilationUnitDeclaration cud = (CompilationUnitDeclaration) top().get(); - - if (cud.compilationResult().getCompilationUnit() instanceof JavaElement) { - JavaElement icu = (JavaElement) cud.compilationResult.compilationUnit; - return (JavaProject) icu.getJavaProject(); - } - - char[] fn = cud.compilationResult().getFileName(); - - Matcher m = PROJECT_NAME_FROM_FILEPATH.matcher(new String(fn)); - if (m.matches()) { - String projName = m.group(1); - return getProject0(projName); - } - - return null; - } - - private static JavaProject getProject0(String projectName) { - Project depProjWrapper = (Project) ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); - if (depProjWrapper == null) return null; - if (!JavaProject.hasJavaNature(depProjWrapper)) return null; - return (JavaProject) JavaCore.create(depProjWrapper); - } - /** * Call this method to move an EclipseAST generated for a diet parse to rebuild itself for the full parse - * with filled in method bodies and such. Also propagates problems and errors, which in diet parse |