Skip to content
This repository has been archived by the owner on May 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request git-commit-id#553 from matteobaccan/master
Browse files Browse the repository at this point in the history
Reduced code smell
  • Loading branch information
TheSnoozer authored Apr 23, 2021
2 parents 5130b38 + 5872540 commit 4a1ac8f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
4 changes: 1 addition & 3 deletions core/src/main/java/pl/project13/core/jgit/JGitCommon.java
Original file line number Diff line number Diff line change
Expand Up @@ -341,13 +341,11 @@ public static boolean isRepositoryInDirtyState(Repository repo) throws GitAPIExc
// repo is dirty. JGit does this, so we cannot use the isClean method
// to get the same behaviour. Instead check dirty state without
// status.getUntracked().isEmpty()
boolean isDirty = !(status.getAdded().isEmpty()
return !(status.getAdded().isEmpty()
&& status.getChanged().isEmpty()
&& status.getRemoved().isEmpty()
&& status.getMissing().isEmpty()
&& status.getModified().isEmpty()
&& status.getConflicting().isEmpty());

return isDirty;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
*/
public class FormattingTuple {

public static FormattingTuple NULL = new FormattingTuple(null);
public static final FormattingTuple NULL = new FormattingTuple(null);

private String message;
private Throwable throwable;
Expand Down
12 changes: 2 additions & 10 deletions core/src/main/java/pl/project13/core/log/MessageFormatter.java
Original file line number Diff line number Diff line change
Expand Up @@ -261,19 +261,11 @@ static boolean isEscapedDelimeter(String messagePattern, int delimeterStartIndex
return false;
}
char potentialEscape = messagePattern.charAt(delimeterStartIndex - 1);
if (potentialEscape == ESCAPE_CHAR) {
return true;
} else {
return false;
}
return (potentialEscape == ESCAPE_CHAR);
}

static boolean isDoubleEscaped(String messagePattern, int delimeterStartIndex) {
if (delimeterStartIndex >= 2 && messagePattern.charAt(delimeterStartIndex - 2) == ESCAPE_CHAR) {
return true;
} else {
return false;
}
return (delimeterStartIndex >= 2 && messagePattern.charAt(delimeterStartIndex - 2) == ESCAPE_CHAR);
}

// special treatment of array values was suggested by 'lizongbo'
Expand Down

0 comments on commit 4a1ac8f

Please sign in to comment.