diff --git a/cosky-rest-api/src/main/java/me/ahoo/cosky/rest/security/user/User.java b/cosky-rest-api/src/main/java/me/ahoo/cosky/rest/security/user/User.java index 1c227dfa..c7589d23 100644 --- a/cosky-rest-api/src/main/java/me/ahoo/cosky/rest/security/user/User.java +++ b/cosky-rest-api/src/main/java/me/ahoo/cosky/rest/security/user/User.java @@ -22,7 +22,8 @@ * @author ahoo wang */ public class User { - public static String SUPER_USER = CoSky.COSKY; + + public final static String SUPER_USER = CoSky.COSKY; private String username; private Set roleBind; diff --git a/spring-cloud-starter-cosky-discovery-ribbon/src/main/java/me/ahoo/cosky/discovery/spring/cloud/discovery/ribbon/CoskyServerList.java b/spring-cloud-starter-cosky-discovery-ribbon/src/main/java/me/ahoo/cosky/discovery/spring/cloud/discovery/ribbon/CoskyServerList.java index b3666cdf..881943bc 100644 --- a/spring-cloud-starter-cosky-discovery-ribbon/src/main/java/me/ahoo/cosky/discovery/spring/cloud/discovery/ribbon/CoskyServerList.java +++ b/spring-cloud-starter-cosky-discovery-ribbon/src/main/java/me/ahoo/cosky/discovery/spring/cloud/discovery/ribbon/CoskyServerList.java @@ -49,7 +49,7 @@ private List getCoskyServers() { var getInstancesFuture = serviceDiscovery.getInstances(this.serviceId); var instances = Futures.getUnChecked(getInstancesFuture, Duration.ofSeconds(2)); if (instances.isEmpty()) { - Collections.emptyList(); + return Collections.emptyList(); } return instances.stream().map(CoskyServer::new).collect(Collectors.toList()); }