diff options
Diffstat (limited to 'src/core/lombok/javac/apt')
-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() { |