From 403f515aa28b94f223903c9d400bee3d4fa9b12e Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 25 Jul 2011 20:06:20 +0200 Subject: Delombok with a relative path and in 'output to directory' mode would NPE. Fixes issue #241. --- src/delombok/lombok/delombok/Delombok.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/delombok/lombok') diff --git a/src/delombok/lombok/delombok/Delombok.java b/src/delombok/lombok/delombok/Delombok.java index 91b7c93e..e125d622 100644 --- a/src/delombok/lombok/delombok/Delombok.java +++ b/src/delombok/lombok/delombok/Delombok.java @@ -175,7 +175,7 @@ public class Delombok { try { for (String in : args.input) { - File f = new File(in); + File f = new File(in).getAbsoluteFile(); if (f.isFile()) { delombok.addFile(f.getParentFile(), f.getName()); } else if (f.isDirectory()) { @@ -332,7 +332,7 @@ public class Delombok { in.close(); } } - + public void addFile(File base, String fileName) throws IOException { if (output != null && canonical(base).equals(canonical(output))) throw new IOException( "DELOMBOK: Output file and input file refer to the same filesystem location. Specify a separate path for output."); -- cgit