You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by GitBox <gi...@apache.org> on 2018/01/12 01:07:40 UTC

[GitHub] reta commented on a change in pull request #366: Handle ResponseExceptionMappers

reta commented on a change in pull request #366: Handle ResponseExceptionMappers
URL: https://github.com/apache/cxf/pull/366#discussion_r161118849
 
 

 ##########
 File path: rt/rs/microprofile-client/src/main/java/org/apache/cxf/microprofile/client/MicroProfileClientProviderFactory.java
 ##########
 @@ -91,16 +91,11 @@ protected void setProviders(boolean custom, boolean busGlobal, Object... provide
 
     public List<ResponseExceptionMapper<?>> createResponseExceptionMapper(Message m, Class<?> paramType) {
 
-        List<ResponseExceptionMapper<?>> candidates = new LinkedList<>();
-
-        for (ProviderInfo<ResponseExceptionMapper<?>> em : responseExceptionMappers) {
-            if (handleMapper(em, paramType, m, ResponseExceptionMapper.class, true)) {
-                candidates.add(em.getProvider());
-            }
-        }
-        if (candidates.size() == 0) {
+        if (responseExceptionMappers.isEmpty()) {
             return Collections.emptyList();
         }
+        List<ResponseExceptionMapper<?>> candidates =
 
 Review comment:
   Even shorter: 
   ```
   return Collections.unmodifiableList(responseExceptionMappers
       .stream()
       .map(ProviderInfo::getProvider)
       .sorted(new ResponseExceptionMapperComparator())
       .collect(Collectors.toList()));
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services