You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/03/10 03:18:34 UTC

[GitHub] [incubator-shardingsphere] kimmking commented on a change in pull request #4682: Refactor orchestration phase 1.1

kimmking commented on a change in pull request #4682: Refactor orchestration phase 1.1
URL: https://github.com/apache/incubator-shardingsphere/pull/4682#discussion_r390074242
 
 

 ##########
 File path: sharding-orchestration/sharding-orchestration-core/src/main/java/org/apache/shardingsphere/orchestration/constant/OrchestrationType.java
 ##########
 @@ -39,11 +40,6 @@
      * @return OrchestrationType enum, return {@code null} if not found
      */
     public static OrchestrationType findByValue(final String value) {
-        for (OrchestrationType each : OrchestrationType.values()) {
-            if (each.getValue().equals(value)) {
-                return each;
-            }
-        }
-        return null;
+        return Lists.newArrayList(OrchestrationType.values()).stream().filter(each -> each.getValue().equals(value)).findFirst().get();
 
 Review comment:
   > We need to avoid using guava, Arrays.asList can replace Lists.newArrayList
   
   OK

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services