Revert Guava 20 features until we get the build working properly

*** Original change description ***

Remove deprecated methods with Guava 20 release

***

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=137945126
This commit is contained in:
mcilwain 2016-11-02 07:56:02 -07:00 committed by Ben McIlwain
parent 7206f88c6c
commit 1627bd4975
14 changed files with 29 additions and 34 deletions

View file

@ -91,8 +91,7 @@ public final class TestServer {
try {
server.start();
} catch (Exception e) {
Throwables.throwIfUnchecked(e);
throw new RuntimeException(e);
throw Throwables.propagate(e);
}
UrlChecker.waitUntilAvailable(getUrl("/healthz"), STARTUP_TIMEOUT_MS);
}
@ -130,8 +129,7 @@ public final class TestServer {
}
}, SHUTDOWN_TIMEOUT_MS, TimeUnit.MILLISECONDS, true);
} catch (Exception e) {
Throwables.throwIfUnchecked(e);
throw new RuntimeException(e);
throw Throwables.propagate(e);
}
}
@ -168,20 +166,20 @@ public final class TestServer {
private static Connector createConnector(HostAndPort address) {
SocketConnector connector = new SocketConnector();
connector.setHost(address.getHost());
connector.setHost(address.getHostText());
connector.setPort(address.getPortOrDefault(DEFAULT_PORT));
return connector;
}
/** Converts a bind address into an address that other machines can use to connect here. */
private static HostAndPort createUrlAddress(HostAndPort address) {
if (address.getHost().equals("::") || address.getHost().equals("0.0.0.0")) {
if (address.getHostText().equals("::") || address.getHostText().equals("0.0.0.0")) {
return address.getPortOrDefault(DEFAULT_PORT) == DEFAULT_PORT
? HostAndPort.fromHost(getCanonicalHostName())
: HostAndPort.fromParts(getCanonicalHostName(), address.getPort());
} else {
return address.getPortOrDefault(DEFAULT_PORT) == DEFAULT_PORT
? HostAndPort.fromHost(address.getHost())
? HostAndPort.fromHost(address.getHostText())
: address;
}
}