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
4b487478
Commit
4b487478
authored
Jul 28, 2016
by
张乐
Committed by
GitHub
Jul 28, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #354 from nobodyiam/fix-coverity-bug
fix coverity bugs
parents
16ff5fd9
9bc6b5fb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
ApolloEurekaClientConfig.java
...framework/apollo/biz/eureka/ApolloEurekaClientConfig.java
+4
-0
ReleaseKeyGenerator.java
...ctrip/framework/apollo/biz/utils/ReleaseKeyGenerator.java
+3
-1
ApolloConfigDemo.java
apollo-demo/src/main/java/ApolloConfigDemo.java
+3
-1
No files found.
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/eureka/ApolloEurekaClientConfig.java
View file @
4b487478
...
...
@@ -46,4 +46,8 @@ public class ApolloEurekaClientConfig extends EurekaClientConfigBean {
return
super
.
getEurekaServerServiceUrls
(
myZone
);
}
@Override
public
boolean
equals
(
Object
o
)
{
return
super
.
equals
(
o
);
}
}
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/utils/ReleaseKeyGenerator.java
View file @
4b487478
...
...
@@ -6,6 +6,8 @@ import com.ctrip.framework.apollo.biz.entity.Namespace;
import
com.ctrip.framework.apollo.core.utils.ByteUtil
;
import
com.ctrip.framework.apollo.core.utils.MachineUtil
;
import
org.apache.commons.lang.time.FastDateFormat
;
import
java.security.SecureRandom
;
import
java.text.DateFormat
;
import
java.text.SimpleDateFormat
;
...
...
@@ -17,7 +19,7 @@ import java.util.concurrent.atomic.AtomicInteger;
* @author Jason Song(song_s@ctrip.com)
*/
public
class
ReleaseKeyGenerator
{
private
static
final
DateFormat
TIMESTAMP_FORMAT
=
new
SimpleDateFormat
(
"yyyyMMddHHmmss"
);
private
static
final
FastDateFormat
TIMESTAMP_FORMAT
=
FastDateFormat
.
getInstance
(
"yyyyMMddHHmmss"
);
private
static
final
AtomicInteger
releaseCounter
=
new
AtomicInteger
(
new
SecureRandom
().
nextInt
());
private
static
final
Joiner
KEY_JOINER
=
Joiner
.
on
(
"-"
);
...
...
apollo-demo/src/main/java/ApolloConfigDemo.java
View file @
4b487478
import
com.google.common.base.Charsets
;
import
com.ctrip.framework.apollo.Config
;
import
com.ctrip.framework.apollo.ConfigChangeListener
;
import
com.ctrip.framework.apollo.ConfigFile
;
...
...
@@ -80,7 +82,7 @@ public class ApolloConfigDemo {
"Apollo Config Demo. Please input key to get the value."
);
while
(
true
)
{
System
.
out
.
print
(
"> "
);
String
input
=
new
BufferedReader
(
new
InputStreamReader
(
System
.
in
)).
readLine
();
String
input
=
new
BufferedReader
(
new
InputStreamReader
(
System
.
in
,
Charsets
.
UTF_8
)).
readLine
();
if
(
input
==
null
||
input
.
length
()
==
0
)
{
continue
;
}
...
...
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