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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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();