Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-cloud-netflix
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
spring-cloud-netflix
Commits
2ff2ce4d
Unverified
Commit
2ff2ce4d
authored
May 23, 2016
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only prepend hostname if it has text
parent
69fd8e7e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
CloudJacksonJson.java
...amework/cloud/netflix/eureka/server/CloudJacksonJson.java
+2
-1
No files found.
spring-cloud-netflix-eureka-server/src/main/java/org/springframework/cloud/netflix/eureka/server/CloudJacksonJson.java
View file @
2ff2ce4d
...
@@ -7,6 +7,7 @@ import java.lang.reflect.Field;
...
@@ -7,6 +7,7 @@ import java.lang.reflect.Field;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
org.springframework.util.ReflectionUtils
;
import
org.springframework.util.ReflectionUtils
;
import
org.springframework.util.StringUtils
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.core.JsonGenerator
;
import
com.fasterxml.jackson.core.JsonGenerator
;
...
@@ -133,7 +134,7 @@ public class CloudJacksonJson extends LegacyJacksonJson {
...
@@ -133,7 +134,7 @@ public class CloudJacksonJson extends LegacyJacksonJson {
private
String
calculateInstanceId
(
InstanceInfo
info
)
{
private
String
calculateInstanceId
(
InstanceInfo
info
)
{
String
instanceId
=
info
.
getMetadata
().
get
(
"instanceId"
);
String
instanceId
=
info
.
getMetadata
().
get
(
"instanceId"
);
String
hostName
=
info
.
getHostName
();
String
hostName
=
info
.
getHostName
();
if
(
instanceId
!=
null
&&
!
instanceId
.
startsWith
(
hostName
))
{
if
(
instanceId
!=
null
&&
StringUtils
.
hasText
(
hostName
)
&&
!
instanceId
.
startsWith
(
hostName
))
{
instanceId
=
hostName
+
":"
+
instanceId
;
instanceId
=
hostName
+
":"
+
instanceId
;
}
}
return
instanceId
==
null
?
hostName
:
instanceId
;
return
instanceId
==
null
?
hostName
:
instanceId
;
...
...
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