diff options
author | Roel Spilker <r.spilker@gmail.com> | 2013-12-15 21:02:09 +0100 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2013-12-15 21:02:09 +0100 |
commit | 930b17b85be652405bf47752d1dbf4272afbace1 (patch) | |
tree | 10d50551c069fa6dd34d5857b7bf10516717cef8 /src/core/lombok/javac | |
parent | 324022b71903ae5a9a61e9e9a3d7eb92d3d9d96c (diff) | |
download | lombok-930b17b85be652405bf47752d1dbf4272afbace1.tar.gz lombok-930b17b85be652405bf47752d1dbf4272afbace1.tar.bz2 lombok-930b17b85be652405bf47752d1dbf4272afbace1.zip |
[configuration] Added the .getAbsoluteFileLocation() method to AST;
this now works properly (even with eclipse Linked Resources) in both
eclipse and javac. We will now use this feature to search for and apply
config files, which will apply hierarchically based on the directory of
the source file.
Diffstat (limited to 'src/core/lombok/javac')
-rw-r--r-- | src/core/lombok/javac/JavacAST.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/core/lombok/javac/JavacAST.java b/src/core/lombok/javac/JavacAST.java index 31bdc3a6..5064f852 100644 --- a/src/core/lombok/javac/JavacAST.java +++ b/src/core/lombok/javac/JavacAST.java @@ -22,6 +22,7 @@ package lombok.javac; import java.lang.reflect.Field; +import java.net.URI; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -88,7 +89,16 @@ public class JavacAST extends AST<JavacAST, JavacNode, JCTree> { this.javacTypes = JavacTypes.instance(context); clearChanged(); } - + + @Override public URI getAbsoluteFileLocation() { + try { + JCCompilationUnit cu = (JCCompilationUnit) top().get(); + return cu.sourcefile.toUri(); + } catch (Exception e) { + return null; + } + } + private static String sourceName(JCCompilationUnit cu) { return cu.sourcefile == null ? null : cu.sourcefile.toString(); } |