#682: bugfix work in progress to fix IllegalArgumentException ‘Path must include project and resource name’.

This commit is contained in:
Reinier Zwitserloot
2014-05-30 03:00:41 +02:00
parent 48c93ecc30
commit 06371ca258
2 changed files with 14 additions and 2 deletions
+1
View File
@@ -2,6 +2,7 @@ Lombok Changelog
----------------
### v1.14.1 "Edgy Guinea Pig"
* BUGFIX-IN-PROGRESS: As yet unknown conditions in eclipse result in lots of `IllegalArgumentException` in the log with message "Path must include project and resource name". This edge release will no longer error out, but we need to know when or how this occurs, thus, warnings will appear instead in your log with information pertinent to solving this issue. Please report these warnings back to us. [Issue #682](https://code.google.com/p/projectlombok/issues/detail?id=682)
* BUGFIX: mvn builds fail with a 'URI not absolute' exception. [Issue #683](https://code.google.com/p/projectlombok/issues/detail?id=683)
### v1.14.0 "Branching Cobra" (May 27th, 2014)
+13 -2
View File
@@ -70,9 +70,20 @@ public class EclipseAST extends AST<EclipseAST, EclipseNode, ASTNode> {
private static volatile boolean skipEclipseWorkspaceBasedFileResolver = false;
public URI getAbsoluteFileLocation() {
String fileName = getFileName();
if (!skipEclipseWorkspaceBasedFileResolver) {
try {
return EclipseWorkspaceBasedFileResolver.resolve(getFileName());
/*if (fileName.startsWith("/") && fileName.indexOf('/', 1) > -1) */
try {
return EclipseWorkspaceBasedFileResolver.resolve(fileName);
} catch (IllegalArgumentException e) {
String msg = e.getMessage();
if (msg != null && msg.startsWith("Path must include project and resource name")) {
// go with the fallthrough, but log that this happened.
addProblem(new ParseProblem(true, "Path resolution for lombok.config failed. Path: " + fileName + " -- falling back to: " + new File(fileName).getAbsoluteFile(), 0, 1));
} else throw e;
}
} catch (NoClassDefFoundError e) {
skipEclipseWorkspaceBasedFileResolver = true;
}
@@ -80,7 +91,7 @@ public class EclipseAST extends AST<EclipseAST, EclipseNode, ASTNode> {
// Our fancy workspace based source file to absolute disk location algorithm only works in a fully fledged eclipse.
// This fallback works when using 'ecj', which has a much simpler project/path system. For example, no 'linked' resources.
return new File(getFileName()).getAbsoluteFile().toURI();
return new File(fileName).getAbsoluteFile().toURI();
}
private static class EclipseWorkspaceBasedFileResolver {