Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
apollo
Commits
f7f321ca
Commit
f7f321ca
authored
Aug 16, 2017
by
Jason Song
Committed by
GitHub
Aug 16, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #698 from powerYao/master
use emptyList instead of creating a new list every time.
parents
d61803b4
5ad3c0e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
DiscoveryService.java
...ramework/apollo/metaservice/service/DiscoveryService.java
+4
-4
No files found.
apollo-configservice/src/main/java/com/ctrip/framework/apollo/metaservice/service/DiscoveryService.java
View file @
f7f321ca
...
@@ -9,7 +9,7 @@ import com.netflix.discovery.shared.Application;
...
@@ -9,7 +9,7 @@ import com.netflix.discovery.shared.Application;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.
ArrayList
;
import
java.util.
Collections
;
import
java.util.List
;
import
java.util.List
;
@Service
@Service
...
@@ -23,7 +23,7 @@ public class DiscoveryService {
...
@@ -23,7 +23,7 @@ public class DiscoveryService {
if
(
application
==
null
)
{
if
(
application
==
null
)
{
Tracer
.
logEvent
(
"Apollo.EurekaDiscovery.NotFound"
,
ServiceNameConsts
.
APOLLO_CONFIGSERVICE
);
Tracer
.
logEvent
(
"Apollo.EurekaDiscovery.NotFound"
,
ServiceNameConsts
.
APOLLO_CONFIGSERVICE
);
}
}
return
application
!=
null
?
application
.
getInstances
()
:
new
ArrayList
<>
();
return
application
!=
null
?
application
.
getInstances
()
:
Collections
.
emptyList
();
}
}
public
List
<
InstanceInfo
>
getMetaServiceInstances
()
{
public
List
<
InstanceInfo
>
getMetaServiceInstances
()
{
...
@@ -31,7 +31,7 @@ public class DiscoveryService {
...
@@ -31,7 +31,7 @@ public class DiscoveryService {
if
(
application
==
null
)
{
if
(
application
==
null
)
{
Tracer
.
logEvent
(
"Apollo.EurekaDiscovery.NotFound"
,
ServiceNameConsts
.
APOLLO_METASERVICE
);
Tracer
.
logEvent
(
"Apollo.EurekaDiscovery.NotFound"
,
ServiceNameConsts
.
APOLLO_METASERVICE
);
}
}
return
application
!=
null
?
application
.
getInstances
()
:
new
ArrayList
<>
();
return
application
!=
null
?
application
.
getInstances
()
:
Collections
.
emptyList
();
}
}
public
List
<
InstanceInfo
>
getAdminServiceInstances
()
{
public
List
<
InstanceInfo
>
getAdminServiceInstances
()
{
...
@@ -39,6 +39,6 @@ public class DiscoveryService {
...
@@ -39,6 +39,6 @@ public class DiscoveryService {
if
(
application
==
null
)
{
if
(
application
==
null
)
{
Tracer
.
logEvent
(
"Apollo.EurekaDiscovery.NotFound"
,
ServiceNameConsts
.
APOLLO_ADMINSERVICE
);
Tracer
.
logEvent
(
"Apollo.EurekaDiscovery.NotFound"
,
ServiceNameConsts
.
APOLLO_ADMINSERVICE
);
}
}
return
application
!=
null
?
application
.
getInstances
()
:
new
ArrayList
<>
();
return
application
!=
null
?
application
.
getInstances
()
:
Collections
.
emptyList
();
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment