[ 
https://issues.apache.org/jira/browse/SCB-447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16420053#comment-16420053
 ] 

ASF GitHub Bot commented on SCB-447:
------------------------------------

WillemJiang commented on a change in pull request #626: [SCB-447] Optimize 
SPIServiceUtils
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/626#discussion_r178218879
 
 

 ##########
 File path: 
foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/utils/SPIServiceUtils.java
 ##########
 @@ -76,18 +63,65 @@ private SPIServiceUtils() {
       serviceEntries.add(entry);
     });
 
-    return serviceEntries.stream()
+    List<T> services = serviceEntries.stream()
         .sorted(Comparator.comparingInt(Entry::getKey))
         .map(Entry::getValue)
         .collect(Collectors.toList());
+
+    LOGGER.info("Found SPI service {}, count={}.", serviceType.getName(), 
services.size());
+    for (int idx = 0; idx < services.size(); idx++) {
 
 Review comment:
   Can we use the accumulator to do this job ?

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


> optimize SPIServiceUtils to avoid get different instance for the same type
> --------------------------------------------------------------------------
>
>                 Key: SCB-447
>                 URL: https://issues.apache.org/jira/browse/SCB-447
>             Project: Apache ServiceComb
>          Issue Type: Improvement
>          Components: Java-Chassis
>            Reporter: wujimin
>            Assignee: wujimin
>            Priority: Major
>             Fix For: java-chassis-1.0.0-m2
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to