style: unnecessary conditions and expressions simplified

This commit is contained in:
Nadya Zabrodina
2014-02-06 12:45:22 +04:00
parent c5f9c1f5a7
commit 0d514da1db
3 changed files with 6 additions and 10 deletions
@@ -69,13 +69,12 @@ public class HgCheckoutProvider implements CheckoutProvider {
// handle result
HgCommandResult myCloneResult = clone.execute();
if (myCloneResult == null) {
new HgCommandResultNotifier(project).notifyError(null, "Clone failed", "Clone failed due to unknown error");
} else if (HgErrorUtil.hasErrorsInCommandExecution(myCloneResult)) {
if (myCloneResult == null || HgErrorUtil.hasErrorsInCommandExecution(myCloneResult)) {
new HgCommandResultNotifier(project).notifyError(myCloneResult, "Clone failed", "Clone from " +
sourceRepositoryURL +
" failed.");
} else {
}
else {
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
@@ -197,9 +197,6 @@ public class HgHistoryUtil {
@Nullable
public static List<String> prepareHashes(@NotNull List<String> hashes) {
if (hashes.isEmpty()) {
return Collections.emptyList();
}
List<String> hashArgs = new ArrayList<String>();
for (String hash : hashes) {
hashArgs.add("-r");
@@ -30,6 +30,7 @@ import java.util.List;
import static com.intellij.openapi.vcs.Executor.cd;
import static com.intellij.openapi.vcs.Executor.touch;
import static hg4idea.test.HgExecutor.hg;
import static java.util.Calendar.YEAR;
/**
* @author Nadya Zabrodina
@@ -52,10 +53,9 @@ public class HgBrowseChangesTest extends HgPlatformTest {
hg("add");
hg("commit -m add");
java.util.Calendar now = java.util.Calendar.getInstance();
int year = java.util.Calendar.YEAR;
now.set(year, now.get(year) + 1);
now.add(YEAR, 1);
dateBefore = ChangeBrowserSettings.DATE_FORMAT.format(now.getTime());
now.set(year, 1970);
now.set(YEAR, 1970);
dateAfter = ChangeBrowserSettings.DATE_FORMAT.format(now.getTime());
}