Skip to content

Commit

Permalink
#43 fix the priority level of properties
Browse files Browse the repository at this point in the history
  • Loading branch information
IvyLee-cn committed Apr 30, 2019
1 parent 9cdad84 commit 500aef0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
import com.vip.pallas.utils.PallasBasicProperties;

/*
* Order
* env --> key
* env --> key.replace(".", "_").toUpperCase()
* priority levels, from high to low
* jvm args --> key
* jvm args --> key.replace(".", "_").toUpperCase()
* env --> key
* env --> key.replace(".", "_").toUpperCase()
* app props --> key
*/
public class DefaultPropertyProcessor extends AbstractPropertyProcessor {
Expand All @@ -45,14 +45,16 @@ protected DefaultPropertyProcessor() {

protected String getValue(String key) {
Objects.requireNonNull(key);
String val = getEnv(key);
if (null != val) {
return val;
}
val = getSystem(key);
String val = getSystem(key);
if (null != val) {
return val;
}

val = getEnv(key);
if (null != val) {
return val;
}

return getProperty(key);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
import com.vip.pallas.utils.ConfigReader;

/*
* Order
* env --> key
* env --> key.replace(".", "_").toUpperCase()
* priority levels, from high to low
* jvm args --> key
* jvm args --> key.replace(".", "_").toUpperCase()
* env --> key
* env --> key.replace(".", "_").toUpperCase()
* app props --> key
* spring props --> key
*/
Expand Down

0 comments on commit 500aef0

Please sign in to comment.