mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 14:16:11 +00:00
Delombok with a relative path and in 'output to directory' mode would NPE. Fixes issue #241.
This commit is contained in:
1 parent
b325214e82
commit
403f515aa2
2 files changed
+4
-4
No files matched your search
@@ -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.");
|
||||
|
||||
@@ -53,8 +53,8 @@ public class RunTestsViaDelombok extends AbstractRunTests {
|
||||
}
|
||||
});
|
||||
|
||||
delombok.addFile(file.getParentFile(), file.getName());
|
||||
delombok.setSourcepath(file.getParentFile().getAbsolutePath());
|
||||
delombok.addFile(file.getAbsoluteFile().getParentFile(), file.getName());
|
||||
delombok.setSourcepath(file.getAbsoluteFile().getParent());
|
||||
delombok.setWriter(result);
|
||||
delombok.delombok();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user