diff options
3 files changed, 13 insertions, 15 deletions
diff --git a/src/core/lombok/core/handlers/SneakyThrowsDependencyInfo.java b/src/core/lombok/core/handlers/SneakyThrowsDependencyInfo.java index 1b860f6d..20615183 100644 --- a/src/core/lombok/core/handlers/SneakyThrowsDependencyInfo.java +++ b/src/core/lombok/core/handlers/SneakyThrowsDependencyInfo.java @@ -32,7 +32,7 @@ import org.mangosdk.spi.ProviderFor; public class SneakyThrowsDependencyInfo implements RuntimeDependencyInfo { @Override public List<String> getRuntimeDependencies() { return Arrays.asList( - "/lombok/Lombok.class" + "lombok/Lombok.class" ); } diff --git a/src/core/lombok/core/runtimeDependencies/CreateLombokRuntimeApp.java b/src/core/lombok/core/runtimeDependencies/CreateLombokRuntimeApp.java index 6f39082e..3a83bea1 100644 --- a/src/core/lombok/core/runtimeDependencies/CreateLombokRuntimeApp.java +++ b/src/core/lombok/core/runtimeDependencies/CreateLombokRuntimeApp.java @@ -146,11 +146,11 @@ public class CreateLombokRuntimeApp implements LombokApp { } private int writeRuntimeJar(File outFile) throws Exception { - Map<Class<?>, List<String>> deps = new LinkedHashMap<Class<?>, List<String>>(); + Map<String, Class<?>> deps = new LinkedHashMap<String, Class<?>>(); for (RuntimeDependencyInfo info : infoObjects) { List<String> depNames = info.getRuntimeDependencies(); - if (depNames != null && !depNames.isEmpty()) { - deps.put(info.getClass(), depNames); + if (depNames != null) for (String depName : depNames) { + if (!deps.containsKey(depName)) deps.put(depName, info.getClass()); } } @@ -163,17 +163,15 @@ public class CreateLombokRuntimeApp implements LombokApp { boolean success = false; try { JarOutputStream jar = new JarOutputStream(out); - for (Entry<Class<?>, List<String>> dep : deps.entrySet()) { - for (String depName : dep.getValue()) { - InputStream in = dep.getKey().getResourceAsStream(depName); - try { - if (in == null) { - throw new Fail(String.format("Dependency %s contributed by %s cannot be found", depName, dep.getKey().getName())); - } - writeIntoJar(jar, depName, in); - } finally { - if (in != null) in.close(); + for (Entry<String, Class<?>> dep : deps.entrySet()) { + InputStream in = dep.getValue().getResourceAsStream("/" + dep.getKey()); + try { + if (in == null) { + throw new Fail(String.format("Dependency %s contributed by %s cannot be found", dep.getKey(), dep.getValue())); } + writeIntoJar(jar, dep.getKey(), in); + } finally { + if (in != null) in.close(); } } jar.close(); diff --git a/src/core/lombok/core/runtimeDependencies/RuntimeDependencyInfo.java b/src/core/lombok/core/runtimeDependencies/RuntimeDependencyInfo.java index e83332c8..63c04fca 100644 --- a/src/core/lombok/core/runtimeDependencies/RuntimeDependencyInfo.java +++ b/src/core/lombok/core/runtimeDependencies/RuntimeDependencyInfo.java @@ -34,7 +34,7 @@ public interface RuntimeDependencyInfo { public List<String> getRuntimeDependentsDescriptions(); /** - * @return A list of files (findable via {@code yourClass.getResourceAsStream(NAME)}) to include in + * @return A list of files (findable via {@code yourClass.getResourceAsStream("/" + NAME)}) to include in * {@code lombok-runtime.jar}. */ public List<String> getRuntimeDependencies(); |