Fix sonar issues

This commit is contained in:
Rene Pfeuffer
2019-10-09 11:47:56 +02:00
parent c5bbfa8af9
commit 5eab6f5af4

View File

@@ -54,10 +54,9 @@ public class GitModifyCommand extends AbstractGitCommand implements ModifyComman
@Override
String run() throws IOException {
getClone().getRepository().getFullBranch();
if (!StringUtils.isEmpty(request.getExpectedRevision())) {
if (!request.getExpectedRevision().equals(getCurrentRevision().getName())) {
throw new ConcurrentModificationException("branch", request.getBranch() == null? "default": request.getBranch());
}
if (!StringUtils.isEmpty(request.getExpectedRevision())
&& !request.getExpectedRevision().equals(getCurrentRevision().getName())) {
throw new ConcurrentModificationException("branch", request.getBranch() == null ? "default" : request.getBranch());
}
for (ModifyCommandRequest.PartialRequest r : request.getRequests()) {
r.execute(this);
@@ -128,9 +127,9 @@ public class GitModifyCommand extends AbstractGitCommand implements ModifyComman
}
return path;
}
}
private String throwInternalRepositoryException(String message, Exception e) {
throw new InternalRepositoryException(context.getRepository(), message, e);
private String throwInternalRepositoryException(String message, Exception e) {
throw new InternalRepositoryException(context.getRepository(), message, e);
}
}
}