boolean (@NotNull FilePath file, @NotNull Change change, @NotNull FilePath beforeFile) { boolean isParentReplaced = change.isIsReplaced() && (!file.equals(beforeFile)); boolean isMovedRenamed = change.isMoved() || change.isRenamed(); // call FilePath.isUnder() only if change is either "parent replaced" or moved/renamed - as many calls to FilePath.isUnder() // could take a lot of time boolean underBefore = (isParentReplaced || isMovedRenamed) && file.isUnder(beforeFile, false); if (underBefore) { debug(isParentReplaced ? "For " + file + "some of parents is replaced: " + beforeFile : "For " + file + "some of parents was renamed/moved: " + beforeFile); return true; } return false; }