From 65b735c8599af0cefaa5903d83ab9ab2133f0c92 Mon Sep 17 00:00:00 2001
From: Roel Spilker <r.spilker@gmail.com>
Date: Tue, 24 Jun 2014 20:48:17 +0200
Subject: [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.

---
 src/core/lombok/eclipse/EclipseAST.java                  | 7 ++++++-
 src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java | 2 +-
 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);
-- 
cgit