Address error-prone AssertFalse warnings

This commit is contained in:
Andrew Gaul 2016-04-27 18:53:18 -07:00
parent 04f1bb2b49
commit cdbf856900
4 changed files with 7 additions and 10 deletions

View File

@ -121,9 +121,7 @@ public class Throwables2 {
AuthorizationException aex = getFirstThrowableOfType(e, AuthorizationException.class);
if (aex != null)
throw aex;
propagate(e);
assert false : "exception should have propagated " + e;
return null;
throw propagate(e);
}
// Note that ordering matters to propagateIfPossible.

View File

@ -33,6 +33,7 @@ import org.jclouds.concurrent.config.ExecutorServiceModule;
import org.jclouds.lifecycle.Closer;
import org.testng.annotations.Test;
import com.google.common.base.Throwables;
import com.google.common.util.concurrent.ExecutionList;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.inject.AbstractModule;
@ -130,7 +131,7 @@ public class LifeCycleModuleTest {
assert closer.getState() == Closer.State.PROCESSING;
closeDone.await();
} catch (InterruptedException e) {
assert false : e.getMessage();
throw Throwables.propagate(e);
}
}
});
@ -141,7 +142,7 @@ public class LifeCycleModuleTest {
try {
closer.close();
} catch (IOException e) {
assert false : e.getMessage();
throw Throwables.propagate(e);
}
}
});
@ -180,7 +181,7 @@ public class LifeCycleModuleTest {
try {
closer.close();
} catch (IOException e) {
assert false : e.getMessage();
throw Throwables.propagate(e);
}
}
};

View File

@ -190,8 +190,7 @@ public class JschSshClient implements SshClient {
}
}
}
assert false : "should not reach here";
return null;
throw new AssertionError("should not reach here");
}
public void connect() {

View File

@ -216,8 +216,7 @@ public class SshjSshClient implements SshClient {
}
}
}
assert false : "should not reach here";
return null;
throw new AssertionError("should not reach here");
}
public void connect() {