Invert a test to reduce indent.
Summary:
I'm going to make this method more complicated, so preemptively reducing
the indent.
Test Plan: Unit tests.
diff --git a/src/com/facebook/buck/util/concurrent/MoreFutures.java b/src/com/facebook/buck/util/concurrent/MoreFutures.java
index a59e77a..6f4d175 100644
--- a/src/com/facebook/buck/util/concurrent/MoreFutures.java
+++ b/src/com/facebook/buck/util/concurrent/MoreFutures.java
@@ -64,22 +64,22 @@
* cancelled.
*/
public static boolean isSuccess(ListenableFuture<?> future) {
- if (future.isDone()) {
- try {
- future.get();
- return true;
- } catch (ExecutionException e) {
- // The computation threw an exception, so it did not complete successfully.
- return false;
- } catch (CancellationException e) {
- // The computation was cancelled, so it did not complete successfully.
- return false;
- } catch (InterruptedException e) {
- throw new RuntimeException("Should not be possible to interrupt a resolved future.", e);
- }
- } else {
+ if (!future.isDone()) {
return false;
}
+
+ try {
+ future.get();
+ return true;
+ } catch (ExecutionException e) {
+ // The computation threw an exception, so it did not complete successfully.
+ return false;
+ } catch (CancellationException e) {
+ // The computation was cancelled, so it did not complete successfully.
+ return false;
+ } catch (InterruptedException e) {
+ throw new RuntimeException("Should not be possible to interrupt a resolved future.", e);
+ }
}
/**