Adds notes about fields in types explicitly new'ed
This commit is contained in:
@@ -21,6 +21,7 @@ import java.net.InetAddress;
|
||||
import org.springframework.cloud.client.ServiceInstance;
|
||||
import org.springframework.cloud.client.discovery.DiscoveryClient;
|
||||
import org.springframework.cloud.sleuth.Span;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* An {@link HostLocator} that tries to find local service information from a
|
||||
@@ -35,6 +36,7 @@ public class DiscoveryClientHostLocator implements HostLocator {
|
||||
|
||||
public DiscoveryClientHostLocator(DiscoveryClient client) {
|
||||
this.client = client;
|
||||
Assert.notNull(this.client, "client");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,6 +20,7 @@ import org.springframework.boot.autoconfigure.web.ServerProperties;
|
||||
import org.springframework.boot.context.embedded.EmbeddedServletContainerInitializedEvent;
|
||||
import org.springframework.cloud.sleuth.Span;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
@@ -27,14 +28,15 @@ import org.springframework.context.event.EventListener;
|
||||
*/
|
||||
public class ServerPropertiesHostLocator implements HostLocator {
|
||||
|
||||
private final ServerProperties serverProperties;
|
||||
private final ServerProperties serverProperties; // Nullable
|
||||
private final String appName;
|
||||
private Integer port;
|
||||
private Integer port; // Lazy assigned
|
||||
|
||||
public ServerPropertiesHostLocator(ServerProperties serverProperties,
|
||||
String appName) {
|
||||
this.serverProperties = serverProperties;
|
||||
this.appName = appName;
|
||||
Assert.notNull(this.appName, "appName");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user