You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ni...@apache.org on 2018/02/08 10:28:19 UTC
[incubator-servicecomb-java-chassis] branch master updated (7b99da6
-> 05de3cf)
This is an automated email from the ASF dual-hosted git repository.
ningjiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git.
from 7b99da6 use SPI to read version,so can read version from cse or spring cloud too.
new 5c0ff5f [SCB-315] Resolve the Registry-Service UT test fail
new 05de3cf [SCB-315] Resolve the Registry-Service UT test fail
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../foundation/vertx/AddressResolverConfig.java | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
--
To stop receiving notification emails like this one, please contact
ningjiang@apache.org.
[incubator-servicecomb-java-chassis] 02/02: [SCB-315] Resolve the
Registry-Service UT test fail
Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git
commit 05de3cfa3c4d65725ba86c37dc25ec8c1f8ddfe7
Author: jeho0815 <je...@email.com>
AuthorDate: Wed Feb 7 17:08:20 2018 +0800
[SCB-315] Resolve the Registry-Service UT test fail
---
.../foundation/vertx/AddressResolverConfig.java | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/AddressResolverConfig.java b/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/AddressResolverConfig.java
index bf19919..90f3865 100644
--- a/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/AddressResolverConfig.java
+++ b/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/AddressResolverConfig.java
@@ -109,9 +109,7 @@ public class AddressResolverConfig {
private static List<String> getStringListProperty(Configuration configSource,
List<String> defaultValue, String... keys) {
- if (configSource == null && DynamicPropertyFactory.getBackingConfigurationSource() != null) {
- configSource = (Configuration) DynamicPropertyFactory.getBackingConfigurationSource();
- }
+ configSource = guardConfigSource(configSource);
if (configSource == null) {
return defaultValue;
}
@@ -125,9 +123,7 @@ public class AddressResolverConfig {
}
private static int getPositiveIntProperty(Configuration configSource, int defaultValue, String... keys) {
- if (configSource == null && DynamicPropertyFactory.getBackingConfigurationSource() != null) {
- configSource = (Configuration) DynamicPropertyFactory.getBackingConfigurationSource();
- }
+ configSource = guardConfigSource(configSource);
if (configSource == null) {
return defaultValue;
}
@@ -146,9 +142,7 @@ public class AddressResolverConfig {
private static boolean getBooleanProperty(Configuration configSource, boolean defaultValue,
String... keys) {
- if (configSource == null && DynamicPropertyFactory.getBackingConfigurationSource() != null) {
- configSource = (Configuration) DynamicPropertyFactory.getBackingConfigurationSource();
- }
+ configSource = guardConfigSource(configSource);
if (configSource == null) {
return defaultValue;
}
@@ -160,4 +154,11 @@ public class AddressResolverConfig {
}
return defaultValue;
}
+
+ private static Configuration guardConfigSource(Configuration configSource) {
+ if (configSource == null && DynamicPropertyFactory.getBackingConfigurationSource() != null) {
+ configSource = (Configuration) DynamicPropertyFactory.getBackingConfigurationSource();
+ }
+ return configSource;
+ }
}
--
To stop receiving notification emails like this one, please contact
ningjiang@apache.org.
[incubator-servicecomb-java-chassis] 01/02: [SCB-315] Resolve the
Registry-Service UT test fail
Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git
commit 5c0ff5fca79643dc9c5c4ba37d6a631688fd539e
Author: jeho0815 <je...@email.com>
AuthorDate: Sat Feb 3 16:35:26 2018 +0800
[SCB-315] Resolve the Registry-Service UT test fail
---
.../foundation/vertx/AddressResolverConfig.java | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/AddressResolverConfig.java b/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/AddressResolverConfig.java
index 1b1a804..bf19919 100644
--- a/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/AddressResolverConfig.java
+++ b/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/AddressResolverConfig.java
@@ -109,9 +109,12 @@ public class AddressResolverConfig {
private static List<String> getStringListProperty(Configuration configSource,
List<String> defaultValue, String... keys) {
- if (configSource == null) {
+ if (configSource == null && DynamicPropertyFactory.getBackingConfigurationSource() != null) {
configSource = (Configuration) DynamicPropertyFactory.getBackingConfigurationSource();
}
+ if (configSource == null) {
+ return defaultValue;
+ }
for (String key : keys) {
String[] vals = configSource.getStringArray(key);
if (vals != null && vals.length > 0) {
@@ -122,9 +125,12 @@ public class AddressResolverConfig {
}
private static int getPositiveIntProperty(Configuration configSource, int defaultValue, String... keys) {
- if (configSource == null) {
+ if (configSource == null && DynamicPropertyFactory.getBackingConfigurationSource() != null) {
configSource = (Configuration) DynamicPropertyFactory.getBackingConfigurationSource();
}
+ if (configSource == null) {
+ return defaultValue;
+ }
for (String key : keys) {
Integer val = configSource.getInteger(key, null);
if (val != null && val <= 0) {
@@ -140,9 +146,12 @@ public class AddressResolverConfig {
private static boolean getBooleanProperty(Configuration configSource, boolean defaultValue,
String... keys) {
- if (configSource == null) {
+ if (configSource == null && DynamicPropertyFactory.getBackingConfigurationSource() != null) {
configSource = (Configuration) DynamicPropertyFactory.getBackingConfigurationSource();
}
+ if (configSource == null) {
+ return defaultValue;
+ }
for (String key : keys) {
Boolean val = configSource.getBoolean(key, null);
if (val != null) {
--
To stop receiving notification emails like this one, please contact
ningjiang@apache.org.