From 03740f136932a507e17b19c630cbd64ba33d79ec Mon Sep 17 00:00:00 2001 From: Michael Tecourt Date: Thu, 23 Mar 2017 19:23:25 +0100 Subject: [PATCH] Make EurekaDiscoveryClient.EurekaServiceInstance constructor public (#1794) Make EurekaDiscoveryClient.EurekaServiceInstance constructor public fixes gh-1792 --- .../cloud/netflix/eureka/EurekaDiscoveryClient.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/EurekaDiscoveryClient.java b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/EurekaDiscoveryClient.java index 9a4768f6..2ea849f9 100644 --- a/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/EurekaDiscoveryClient.java +++ b/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/EurekaDiscoveryClient.java @@ -27,6 +27,7 @@ import java.util.Map; import org.springframework.cloud.client.DefaultServiceInstance; import org.springframework.cloud.client.ServiceInstance; import org.springframework.cloud.client.discovery.DiscoveryClient; +import org.springframework.util.Assert; import com.netflix.appinfo.EurekaInstanceConfig; import com.netflix.appinfo.InstanceInfo; @@ -102,7 +103,8 @@ public class EurekaDiscoveryClient implements DiscoveryClient { public static class EurekaServiceInstance implements ServiceInstance { private InstanceInfo instance; - EurekaServiceInstance(InstanceInfo instance) { + public EurekaServiceInstance(InstanceInfo instance) { + Assert.notNull(instance, "Service instance required"); this.instance = instance; }