Comment and deprecation nits

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=146285418
This commit is contained in:
cgoldfeder 2017-02-01 13:57:32 -08:00 committed by Ben McIlwain
parent f17272b197
commit 5d2b83ffe7
2 changed files with 6 additions and 5 deletions

View file

@ -99,7 +99,7 @@ public final class RegistryTestServer {
private final TestServer server; private final TestServer server;
/** @see TestServer#TestServer(HostAndPort, java.util.Map, Iterable, Iterable) */ /** @see TestServer#TestServer(HostAndPort, ImmutableMap, ImmutableList, ImmutableList) */
public RegistryTestServer(HostAndPort address) { public RegistryTestServer(HostAndPort address) {
server = new TestServer(address, RUNFILES, ROUTES, FILTERS); server = new TestServer(address, RUNFILES, ROUTES, FILTERS);
} }

View file

@ -20,6 +20,7 @@ import static com.google.common.util.concurrent.Runnables.doNothing;
import static google.registry.util.NetworkUtils.getCanonicalHostName; import static google.registry.util.NetworkUtils.getCanonicalHostName;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.net.HostAndPort; import com.google.common.net.HostAndPort;
import com.google.common.util.concurrent.SimpleTimeLimiter; import com.google.common.util.concurrent.SimpleTimeLimiter;
import java.net.MalformedURLException; import java.net.MalformedURLException;
@ -84,7 +85,7 @@ public final class TestServer {
*/ */
public TestServer( public TestServer(
HostAndPort address, HostAndPort address,
Map<String, Path> runfiles, ImmutableMap<String, Path> runfiles,
ImmutableList<Route> routes, ImmutableList<Route> routes,
ImmutableList<Class<? extends Filter>> filters) { ImmutableList<Class<? extends Filter>> filters) {
urlAddress = createUrlAddress(address); urlAddress = createUrlAddress(address);
@ -179,20 +180,20 @@ public final class TestServer {
private static Connector createConnector(HostAndPort address) { private static Connector createConnector(HostAndPort address) {
SocketConnector connector = new SocketConnector(); SocketConnector connector = new SocketConnector();
connector.setHost(address.getHostText()); connector.setHost(address.getHost());
connector.setPort(address.getPortOrDefault(DEFAULT_PORT)); connector.setPort(address.getPortOrDefault(DEFAULT_PORT));
return connector; return connector;
} }
/** Converts a bind address into an address that other machines can use to connect here. */ /** Converts a bind address into an address that other machines can use to connect here. */
private static HostAndPort createUrlAddress(HostAndPort address) { private static HostAndPort createUrlAddress(HostAndPort address) {
if (address.getHostText().equals("::") || address.getHostText().equals("0.0.0.0")) { if (address.getHost().equals("::") || address.getHost().equals("0.0.0.0")) {
return address.getPortOrDefault(DEFAULT_PORT) == DEFAULT_PORT return address.getPortOrDefault(DEFAULT_PORT) == DEFAULT_PORT
? HostAndPort.fromHost(getCanonicalHostName()) ? HostAndPort.fromHost(getCanonicalHostName())
: HostAndPort.fromParts(getCanonicalHostName(), address.getPort()); : HostAndPort.fromParts(getCanonicalHostName(), address.getPort());
} else { } else {
return address.getPortOrDefault(DEFAULT_PORT) == DEFAULT_PORT return address.getPortOrDefault(DEFAULT_PORT) == DEFAULT_PORT
? HostAndPort.fromHost(address.getHostText()) ? HostAndPort.fromHost(address.getHost())
: address; : address;
} }
} }