FilePatchStatus (final T patch) { final String beforeName = PathUtil.toSystemIndependentName(patch.getBeforeName()); final String afterName = PathUtil.toSystemIndependentName(patch.getAfterName()); if (patch.isNewFile() || (beforeName == null)) { return FilePatchStatus.ADDED; } else if (patch.isDeletedFile() || (afterName == null)) { return FilePatchStatus.DELETED; } if (beforeName.equals(afterName)) return FilePatchStatus.MODIFIED; return FilePatchStatus.MOVED_OR_RENAMED; }