Source:
<code>public void receiveResponse(final Exchange exchange, final Response response) { if (isTransparentBlockwiseHandlingEnabled()) { if (response.isError()) { switch(response.getCode()) { case REQUEST_ENTITY_INCOMPLETE: case REQUEST_ENTITY_TOO_LARGE: KeyUri key = getKey(exchange, exchange.getCurrentRequest()); clearBlock1Status(key); default: Response resp = new Response(response.getCode()); resp.setToken(exchange.getRequest().getToken()); if (exchange.getRequest().getType() == Type.CON) { resp.setType(Type.ACK); resp.setMID(exchange.getRequest().getMID()); } else { resp.setType(Type.NON); } resp.setSource(response.getSource()); resp.setSourcePort(response.getSourcePort()); resp.setPayload(response.getPayload()); resp.setOptions(response.getOptions()); exchange.setResponse(resp); upper().receiveResponse(exchange, resp); } } else if (!response.hasBlockOption()) { KeyUri key = getKey(exchange, response); <START> Block2BlockwiseStatus status = block2Transfers.get(key); <END> if (response.getOptions().hasObserve() && status != null && status.isNotification() && status.getObserve() < response.getOptions().getObserve()) { exchange.setComplete(); exchange.setCurrentRequest(exchange.getRequest()); clearBlock2Status(key); } exchange.setResponse(response); upper().receiveResponse(exchange, response); } else { if (response.getOptions().hasBlock1()) { handleBlock1Response(exchange, response); } if (response.getOptions().hasBlock2()) { handleBlock2Response(exchange, response); } } } else { exchange.setResponse(response); upper().receiveResponse(exchange, response); } }</code><technical_language>consider getBlock2Status</technical_language>

Target:
public void receiveResponse(final Exchange exchange, final Response response) { if (isTransparentBlockwiseHandlingEnabled()) { if (response.isError()) { switch(response.getCode()) { case REQUEST_ENTITY_INCOMPLETE: case REQUEST_ENTITY_TOO_LARGE: KeyUri key = getKey(exchange, exchange.getCurrentRequest()); clearBlock1Status(key); default: Response resp = new Response(response.getCode()); resp.setToken(exchange.getRequest().getToken()); if (exchange.getRequest().getType() == Type.CON) { resp.setType(Type.ACK); resp.setMID(exchange.getRequest().getMID()); } else { resp.setType(Type.NON); } resp.setSource(response.getSource()); resp.setSourcePort(response.getSourcePort()); resp.setPayload(response.getPayload()); resp.setOptions(response.getOptions()); exchange.setResponse(resp); upper().receiveResponse(exchange, resp); } } else if (!response.hasBlockOption()) { KeyUri key = getKey(exchange, response); Block2BlockwiseStatus status = getBlock2Status(key); if (response.getOptions().hasObserve() && status != null && status.isNotification() && status.getObserve() < response.getOptions().getObserve()) { exchange.setComplete(); exchange.setCurrentRequest(exchange.getRequest()); clearBlock2Status(key); } exchange.setResponse(response); upper().receiveResponse(exchange, response); } else { if (response.getOptions().hasBlock1()) { handleBlock1Response(exchange, response); } if (response.getOptions().hasBlock2()) { handleBlock2Response(exchange, response); } } } else { exchange.setResponse(response); upper().receiveResponse(exchange, response); } }