aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2014-06-24 20:48:17 +0200
committerRoel Spilker <r.spilker@gmail.com>2014-06-24 20:48:17 +0200
commit65b735c8599af0cefaa5903d83ab9ab2133f0c92 (patch)
treecbb4ea87b0927715550571871348013577ed3117 /src
parent01d2115b4f30db85a3c8efbb6dd1bbc8aba16f8a (diff)
downloadlombok-65b735c8599af0cefaa5903d83ab9ab2133f0c92.tar.gz
lombok-65b735c8599af0cefaa5903d83ab9ab2133f0c92.tar.bz2
lombok-65b735c8599af0cefaa5903d83ab9ab2133f0c92.zip
[issue 699] fileName (for finding absolute path of a source file) are sometimes URIs, for example with GWT. We now do the right thing here instead of crashing out.
Diffstat (limited to 'src')
-rw-r--r--src/core/lombok/eclipse/EclipseAST.java7
-rw-r--r--src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java2
2 files changed, 7 insertions, 2 deletions
diff --git a/src/core/lombok/eclipse/EclipseAST.java b/src/core/lombok/eclipse/EclipseAST.java
index 560cbf5c..58621e7f 100644
--- a/src/core/lombok/eclipse/EclipseAST.java
+++ b/src/core/lombok/eclipse/EclipseAST.java
@@ -72,7 +72,12 @@ public class EclipseAST extends AST<EclipseAST, EclipseNode, ASTNode> {
private static volatile boolean skipEclipseWorkspaceBasedFileResolver = false;
public URI getAbsoluteFileLocation() {
String fileName = getFileName();
-
+ if (fileName != null && (fileName.startsWith("file:") || fileName.startsWith("sourcecontrol:"))) {
+ // Some exotic build systems get real fancy with filenames. Known culprits:
+ // The 'jazz' source control system _probably_ (not confirmed yet) uses sourcecontrol://jazz: urls.
+ // GWT puts file:/D:/etc/etc/etc/Foo.java in here.
+ return URI.create(fileName);
+ }
// state of the research in this:
// * We need an abstraction of a 'directory level'. This abstraction needs 'read()' which returns a string (content of lombok.config) and 'getParent()'.
diff --git a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
index 6a903e4c..546beb9f 100644
--- a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
+++ b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
@@ -143,7 +143,7 @@ public class EclipseHandlerUtil {
if (bundleName == null) bundleName = DEFAULT_BUNDLE;
try {
new EclipseWorkspaceLogger().error(message, bundleName, error);
- } catch (NoClassDefFoundError e) { //standalone ecj does not jave Platform, ILog, IStatus, and friends.
+ } catch (NoClassDefFoundError e) { //standalone ecj does not java Platform, ILog, IStatus, and friends.
new TerminalLogger().error(message, bundleName, error);
}
if (cud != null) EclipseAST.addProblemToCompilationResult(cud.getFileName(), cud.compilationResult, false, message + " - See error log.", 0, 0);