Skip to content

Commit 4a1ac8f

Browse files
authored
Merge pull request #553 from matteobaccan/master
Reduced code smell
2 parents 5130b38 + 5872540 commit 4a1ac8f

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

core/src/main/java/pl/project13/core/jgit/JGitCommon.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,13 +341,11 @@ public static boolean isRepositoryInDirtyState(Repository repo) throws GitAPIExc
341341
// repo is dirty. JGit does this, so we cannot use the isClean method
342342
// to get the same behaviour. Instead check dirty state without
343343
// status.getUntracked().isEmpty()
344-
boolean isDirty = !(status.getAdded().isEmpty()
344+
return !(status.getAdded().isEmpty()
345345
&& status.getChanged().isEmpty()
346346
&& status.getRemoved().isEmpty()
347347
&& status.getMissing().isEmpty()
348348
&& status.getModified().isEmpty()
349349
&& status.getConflicting().isEmpty());
350-
351-
return isDirty;
352350
}
353351
}

core/src/main/java/pl/project13/core/log/FormattingTuple.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
*/
5050
public class FormattingTuple {
5151

52-
public static FormattingTuple NULL = new FormattingTuple(null);
52+
public static final FormattingTuple NULL = new FormattingTuple(null);
5353

5454
private String message;
5555
private Throwable throwable;

core/src/main/java/pl/project13/core/log/MessageFormatter.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -261,19 +261,11 @@ static boolean isEscapedDelimeter(String messagePattern, int delimeterStartIndex
261261
return false;
262262
}
263263
char potentialEscape = messagePattern.charAt(delimeterStartIndex - 1);
264-
if (potentialEscape == ESCAPE_CHAR) {
265-
return true;
266-
} else {
267-
return false;
268-
}
264+
return (potentialEscape == ESCAPE_CHAR);
269265
}
270266

271267
static boolean isDoubleEscaped(String messagePattern, int delimeterStartIndex) {
272-
if (delimeterStartIndex >= 2 && messagePattern.charAt(delimeterStartIndex - 2) == ESCAPE_CHAR) {
273-
return true;
274-
} else {
275-
return false;
276-
}
268+
return (delimeterStartIndex >= 2 && messagePattern.charAt(delimeterStartIndex - 2) == ESCAPE_CHAR);
277269
}
278270

279271
// special treatment of array values was suggested by 'lizongbo'

0 commit comments

Comments
 (0)