File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
apollo-configservice/src/main/java/com/ctrip/framework/apollo/metaservice/service Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 99import org .springframework .beans .factory .annotation .Autowired ;
1010import org .springframework .stereotype .Service ;
1111
12- import java .util .ArrayList ;
12+ import java .util .Collections ;
1313import java .util .List ;
1414
1515@ Service
@@ -23,22 +23,22 @@ public List<InstanceInfo> getConfigServiceInstances() {
2323 if (application == null ) {
2424 Tracer .logEvent ("Apollo.EurekaDiscovery.NotFound" , ServiceNameConsts .APOLLO_CONFIGSERVICE );
2525 }
26- return application != null ? application .getInstances () : new ArrayList <> ();
26+ return application != null ? application .getInstances () : Collections . emptyList ();
2727 }
2828
2929 public List <InstanceInfo > getMetaServiceInstances () {
3030 Application application = eurekaClient .getApplication (ServiceNameConsts .APOLLO_METASERVICE );
3131 if (application == null ) {
3232 Tracer .logEvent ("Apollo.EurekaDiscovery.NotFound" , ServiceNameConsts .APOLLO_METASERVICE );
3333 }
34- return application != null ? application .getInstances () : new ArrayList <> ();
34+ return application != null ? application .getInstances () : Collections . emptyList ();
3535 }
3636
3737 public List <InstanceInfo > getAdminServiceInstances () {
3838 Application application = eurekaClient .getApplication (ServiceNameConsts .APOLLO_ADMINSERVICE );
3939 if (application == null ) {
4040 Tracer .logEvent ("Apollo.EurekaDiscovery.NotFound" , ServiceNameConsts .APOLLO_ADMINSERVICE );
4141 }
42- return application != null ? application .getInstances () : new ArrayList <> ();
42+ return application != null ? application .getInstances () : Collections . emptyList ();
4343 }
4444}
You can’t perform that action at this time.
0 commit comments