Skip to content
This repository was archived by the owner on Sep 21, 2022. It is now read-only.
This repository was archived by the owner on Sep 21, 2022. It is now read-only.

Unreachable code generated when more than one WADL Response per error status code  #68

@glassfishrobot

Description

@glassfishrobot

Where in the wadl is used more than one responses for error cases it produces a code that doesn't compile.

An example of this case:

<response status="200"> 
	<representation mediaType="application/vnd.sdmx.genericdata+xml;version=2.1" element="message:GenericData"/>
</response> 
<response status="400 401 404 500 501 503"> 
	<representation mediaType="*/*" /> 
</response>
	<response status="413"> 
    	<representation mediaType="application/vnd.sdmx.error+xml;version=2.1" element="message:Error"/> 
</response>
**GeneratedClient.java**switch (response.getStatus()) {
  case  400 :
  case  401 :
  case  404 :
  case  500 :
  case  501 :
  case  503 :
      throw new WebApplicationException(response);
      break;
  case  413 :
      throw new ErrorException(response, response.readEntity(ErrorType.class));
}

the "break;" statement before the 413 case causes the error since it is unreachable code.

Affected Versions

[1.1.4]

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions