This is an automated email from the ASF dual-hosted git repository.

liubao pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git


The following commit(s) were added to refs/heads/master by this push:
     new 293a576  Update Configuration.java
293a576 is described below

commit 293a57617218bf5a435656c19e8843d9631ba758
Author: laijianbin <[email protected]>
AuthorDate: Mon Sep 3 11:24:30 2018 +0800

    Update Configuration.java
---
 .../servicecomb/loadbalance/Configuration.java     | 27 ++++++++--------------
 1 file changed, 9 insertions(+), 18 deletions(-)

diff --git 
a/handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/Configuration.java
 
b/handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/Configuration.java
index 2ce09e3..e7a88e0 100644
--- 
a/handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/Configuration.java
+++ 
b/handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/Configuration.java
@@ -128,9 +128,8 @@ public final class Configuration {
       int result = Integer.parseInt(p);
       if (result > 0) {
         return result;
-      } else {
-        return defaultValue;
       }
+      return defaultValue;
     } catch (NumberFormatException e) {
       return defaultValue;
     }
@@ -145,9 +144,8 @@ public final class Configuration {
       int result = Integer.parseInt(p);
       if (result > 0) {
         return result;
-      } else {
-        return defaultValue;
       }
+      return defaultValue;
     } catch (NumberFormatException e) {
       return defaultValue;
     }
@@ -169,9 +167,8 @@ public final class Configuration {
       int result = Integer.parseInt(p);
       if (result <= PERCENT && result > 0) {
         return result;
-      } else {
-        return defaultValue;
       }
+      return defaultValue;
     } catch (NumberFormatException e) {
       return defaultValue;
     }
@@ -186,9 +183,8 @@ public final class Configuration {
       int result = Integer.parseInt(p);
       if (result > 0) {
         return result;
-      } else {
-        return defaultValue;
       }
+      return defaultValue;
     } catch (NumberFormatException e) {
       return defaultValue;
     }
@@ -203,9 +199,9 @@ public final class Configuration {
       int result = Integer.parseInt(p);
       if (result > 0) {
         return result;
-      } else {
-        return defaultValue;
       }
+      return defaultValue;
+
     } catch (NumberFormatException e) {
       return defaultValue;
     }
@@ -221,15 +217,11 @@ public final class Configuration {
     for (String key : keys) {
       property = DynamicPropertyFactory.getInstance().getStringProperty(key, 
null).get();
       if (property != null) {
-        break;
+        return property;
       }
     }
 
-    if (property != null) {
-      return property;
-    } else {
-      return defaultValue;
-    }
+    return defaultValue;
   }
 
   public int getContinuousFailureThreshold(String microservice) {
@@ -241,9 +233,8 @@ public final class Configuration {
       int result = Integer.parseInt(p);
       if (result > 0) {
         return result;
-      } else {
-        return defaultValue;
       }
+      return defaultValue;
     } catch (NumberFormatException e) {
       return defaultValue;
     }

Reply via email to