Skip to content
This repository has been 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

Open
glassfishrobot opened this issue Apr 9, 2013 · 2 comments

Comments

@glassfishrobot
Copy link
Contributor

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]

@glassfishrobot
Copy link
Contributor Author

Reported by spyros

@glassfishrobot
Copy link
Contributor Author

This issue was imported from java.net JIRA WADL-68

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants