aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2014-05-30 02:58:29 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2014-05-30 03:00:41 +0200
commit06371ca2580dc9938e07a9ff0ab86a72ab10fa2f (patch)
tree44d99b57ce94c70982b7aca9230852441f42ef60
parent48c93ecc30b8ee8d04336bf73955293d25f9eeda (diff)
downloadlombok-06371ca2580dc9938e07a9ff0ab86a72ab10fa2f.tar.gz
lombok-06371ca2580dc9938e07a9ff0ab86a72ab10fa2f.tar.bz2
lombok-06371ca2580dc9938e07a9ff0ab86a72ab10fa2f.zip
#682: bugfix work in progress to fix IllegalArgumentException ‘Path must include project and resource name’.
-rw-r--r--doc/changelog.markdown1
-rw-r--r--src/core/lombok/eclipse/EclipseAST.java15
2 files changed, 14 insertions, 2 deletions
diff --git a/doc/changelog.markdown b/doc/changelog.markdown
index 4a9958ed..4f4cbca7 100644
--- a/doc/changelog.markdown
+++ b/doc/changelog.markdown
@@ -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)
diff --git a/src/core/lombok/eclipse/EclipseAST.java b/src/core/lombok/eclipse/EclipseAST.java
index 45551d1c..62a01e59 100644
--- a/src/core/lombok/eclipse/EclipseAST.java
+++ b/src/core/lombok/eclipse/EclipseAST.java
@@ -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 {