From 923948f3b53771cfb6a7d1b8a9f879c396541243 Mon Sep 17 00:00:00 2001 From: Roel Spilker Date: Mon, 12 Jun 2017 23:58:11 +0200 Subject: jdk9: ongoing debugging information for errorprone --- src/core/lombok/javac/apt/LombokFileObjects.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src') 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() { -- cgit