diff options
author | Roel Spilker <r.spilker@gmail.com> | 2017-06-12 23:58:11 +0200 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2017-06-12 23:58:11 +0200 |
commit | 923948f3b53771cfb6a7d1b8a9f879c396541243 (patch) | |
tree | b5f1559fbbe73c132886fc4d73dcfb8ce36261e1 /src/core/lombok | |
parent | a5d5ac8c13179368528702f88072458f701b4063 (diff) | |
download | lombok-923948f3b53771cfb6a7d1b8a9f879c396541243.tar.gz lombok-923948f3b53771cfb6a7d1b8a9f879c396541243.tar.bz2 lombok-923948f3b53771cfb6a7d1b8a9f879c396541243.zip |
jdk9: ongoing debugging information for errorprone
Diffstat (limited to 'src/core/lombok')
-rw-r--r-- | src/core/lombok/javac/apt/LombokFileObjects.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/core/lombok/javac/apt/LombokFileObjects.java b/src/core/lombok/javac/apt/LombokFileObjects.java index 49d1c9f8..242be477 100644 --- a/src/core/lombok/javac/apt/LombokFileObjects.java +++ b/src/core/lombok/javac/apt/LombokFileObjects.java @@ -24,6 +24,7 @@ package lombok.javac.apt; import java.lang.reflect.Method; import java.net.URI; +import java.nio.file.Path; import java.nio.file.Paths; import java.util.concurrent.atomic.AtomicBoolean; @@ -31,10 +32,10 @@ import javax.tools.JavaFileManager; import javax.tools.JavaFileObject; import javax.tools.JavaFileObject.Kind; -import com.sun.tools.javac.file.BaseFileManager; - import lombok.core.DiagnosticsReceiver; +import com.sun.tools.javac.file.BaseFileManager; + //Can't use SimpleJavaFileObject so we copy/paste most of its content here, because javac doesn't follow the interface, //and casts to its own BaseFileObject type. D'oh! final class LombokFileObjects { @@ -148,7 +149,13 @@ final class LombokFileObjects { if (uri.getScheme() == null) { uri = URI.create("file://" + uri); } - return new Javac9BaseFileObjectWrapper(fileManager, Paths.get(uri), fileObject); + Path path; + try { + path = Paths.get(uri); + } catch (IllegalArgumentException e) { + throw new IllegalArgumentException("Problems in URI '" + uri + "' (" + fileObject.toUri() + ")", e); + } + return new Javac9BaseFileObjectWrapper(fileManager, path, fileObject); } @Override public Method getDecoderMethod() { |