title: Try - Double Catch Statement Java
body: <p>I am having an issue not understanding the error message I am getting from my try - catch statement, which has two catches. </p>
  
  <p>I believe everything is correct, however, I am getting an error <code>exception X is never thrown in body of corresponding try statement.</code></p>
  
  <p>I believe the code is correct, but both of the catch clauses are being rejected!</p>
  
  <pre><code>@PUT
  @Path("{id}")
  @Consumes("application/json")
  public Response updatePerson(@PathParam("id") int id, String is) {
      try {
          Person person = readPerson(is);
          person.setId(id);
          Person locPerson = persons.get(id);
          if(locPerson == null){
              throw new WebApplicationException(Response.Status.NOT_FOUND);
          }
          persons.put(person.getId(), person);
  
          return Response.status(Response.Status.OK).build();
      } catch (JSONException e) {
          return Response.status(Response.Status.BAD_REQUEST).build();
      } catch (ParseException e) {
          return Response.status(Response.Status.BAD_REQUEST).build();
      }
  }
  </code></pre>