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

ASF GitHub Bot commented on CXF-7743:
-------------------------------------

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


> wadl2java: generate throws declaration for fault response
> ---------------------------------------------------------
>
>                 Key: CXF-7743
>                 URL: https://issues.apache.org/jira/browse/CXF-7743
>             Project: CXF
>          Issue Type: New Feature
>          Components: Tooling
>    Affects Versions: 3.2.4
>            Reporter: Alexey Markevich
>            Assignee: Alexey Markevich
>            Priority: Major
>
> According to [1] the response status attribute can contains status code. In 
> case 4xx-5xx representation/param/@type can be set to java exception class 
> name.
> Previously the impl can use unchecked exceptions only with raw 
> ResponseExceptionMapper<Exception> on client side.
> 1. https://www.w3.org/Submission/wadl/#x3-200002.10



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

Reply via email to