[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.

This commit is contained in:
Roel Spilker committed 2014-06-24 20:48:17 +02:00
1 parent 01d2115b4f
commit 65b735c859
2 files changed
+7 -2

No files matched your search

+6 -1
View File
@@ -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()'.
@@ -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);