WhiteCat22 commented on a change in pull request #407: [CXF-7716] Reduce 
StringBuilders and other performance changes.
URL: https://github.com/apache/cxf/pull/407#discussion_r183899002
 
 

 ##########
 File path: 
rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
 ##########
 @@ -1508,11 +1509,40 @@ public static boolean matchMimeTypes(MediaType 
requestContentType,
                 }
             }
         }
-
         return new ArrayList<>(supportedMimeTypeList);
+    }
+
+    public static boolean doMimeTypesIntersect(List<MediaType> 
requiredMediaTypes, List<MediaType> userMediaTypes) {
+        for (MediaType requiredType : requiredMediaTypes) {
 
 Review comment:
   This makes sense, but is there another interface that we can use instead of 
BiConsumer? BiConsumer requires Java 1.8 and this is something that we would 
like to see backported to 3.1.X which has 1.7 dependencies. Another thing is 
that we need to have a mechanism to return after the first match during 
NonAccumulatingConsumer .accept() instead of going through the entire double 
for loops. There are several ways to do this, pass in a flag to allow us to 
bail out after first match, return a boolean from accept, or create a new 
isFinished() method to let us know that we are done processing.

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to