Skip to content
Snippets Groups Projects
Verified Commit 59640025 authored by Carlos Galindo's avatar Carlos Galindo
Browse files

SlicingCriterion: fix error when file is in the same folder

parent 8b2d964e
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,7 @@ public class FileLineSlicingCriterion extends LineNumberCriterion {
for (CompilationUnit cu : cus) {
Optional<CompilationUnit.Storage> optStorage = cu.getStorage();
if (optStorage.isPresent() && optStorage.get().getFileName().equals(file.getName())
&& optStorage.get().getDirectory().toAbsolutePath().equals(file.getParentFile().toPath().toAbsolutePath()))
&& optStorage.get().getDirectory().toAbsolutePath().equals(file.toPath().toAbsolutePath().getParent()))
return Optional.of(cu);
}
return Optional.empty();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment