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:
[email protected]


With regards,
Apache Git Services

Reply via email to