mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
update: use the diamond operator
This commit is contained in:
parent
f9ef2d8275
commit
591dcdb966
@ -65,7 +65,7 @@ public class NacosDiscoveryClient implements DiscoveryClient {
|
|||||||
nacosServiceInstance.setHost(instance.getIp());
|
nacosServiceInstance.setHost(instance.getIp());
|
||||||
nacosServiceInstance.setPort(instance.getPort());
|
nacosServiceInstance.setPort(instance.getPort());
|
||||||
nacosServiceInstance.setServiceId(serviceId);
|
nacosServiceInstance.setServiceId(serviceId);
|
||||||
Map<String, String> metadata = new HashMap<String, String>();
|
Map<String, String> metadata = new HashMap<>();
|
||||||
metadata.put("instanceId", instance.getInstanceId());
|
metadata.put("instanceId", instance.getInstanceId());
|
||||||
metadata.put("weight", instance.getWeight() + "");
|
metadata.put("weight", instance.getWeight() + "");
|
||||||
metadata.put("healthy", instance.isHealthy() + "");
|
metadata.put("healthy", instance.isHealthy() + "");
|
||||||
@ -82,7 +82,7 @@ public class NacosDiscoveryClient implements DiscoveryClient {
|
|||||||
|
|
||||||
private static List<ServiceInstance> hostToServiceInstanceList(
|
private static List<ServiceInstance> hostToServiceInstanceList(
|
||||||
List<Instance> instances, String serviceId) {
|
List<Instance> instances, String serviceId) {
|
||||||
List<ServiceInstance> result = new ArrayList<ServiceInstance>(instances.size());
|
List<ServiceInstance> result = new ArrayList<>(instances.size());
|
||||||
for (Instance instance : instances) {
|
for (Instance instance : instances) {
|
||||||
result.add(hostToServiceInstance(instance, serviceId));
|
result.add(hostToServiceInstance(instance, serviceId));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user