amarkevich commented on a change in pull request #419: [CXF-7743] wadl2java: 
generate throws declaration for fault response
URL: https://github.com/apache/cxf/pull/419#discussion_r190556792
 
 

 ##########
 File path: 
tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
 ##########
 @@ -1203,20 +1211,26 @@ private void writeJaxrResponse(StringBuilder sbCode, 
Set<String> imports) {
         sbCode.append(Response.class.getSimpleName()).append(" ");
     }
 
-    private Element getOKResponse(List<Element> responseEls) {
-        for (int i = 0; i < responseEls.size(); i++) {
-            String statusValue = responseEls.get(i).getAttribute("status");
-            if (statusValue.length() == 0) {
-                return responseEls.get(i);
-            }
-            String[] statuses = statusValue.split("\\s");
-            for (String status : statuses) {
-                if (HTTP_OK_STATUSES.contains(status)) {
-                    return responseEls.get(i);
+    private static Element getOKResponse(List<Element> responseEls) {
+        final List<Element> result = getResponses(responseEls, 
HTTP_OK_STATUSES);
 
 Review comment:
   previously a first OK element returned; now all OK elements collected and 
the same first element returned - so getOKResponse behaviour is the same

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