_response.setStatus(statusTextField.getText()); _response.setMessage(messageTextField.getText()); _response.setVersion(versionTextField.getText()); } else if (panel == 1) { _response = _beanShellPanel.getResponse(); } else if (panel == 2) {
_modified = true; invalidatePanels(); }  _response.setStatus(statusTextField.getText()); _response.setMessage(messageTextField.getText()); _response.setVersion(versionTextField.getText()); } else if (panel == 1) { _modified = true; invalidatePanels(); _response = _beanShellPanel.getResponse(); } else if (panel == 2) { if (_textPanel.isModified()) {
    private void updateResponse(int panel) {        if (_editable && panel >= 0) {            if (panel == 0) {// parsed text                _response = (Response) _messagePanel.getMessage();                _response.setStatus(statusTextField.getText());                _response.setMessage(messageTextField.getText());                _response.setVersion(versionTextField.getText());            } else if (panel == 1) {// bean shell                _response = _beanShellPanel.getResponse();            } else if (panel == 2) { // raw text                try {                    Response r = new Response();                    ByteArrayInputStream bais = new ByteArrayInputStream(rawTextArea.getText().getBytes());                    r.read(bais);                    String cl = _response.getHeader("Content-Length");                    if (cl != null) {                        byte[] content = _response.getContent(); // read the content                        if (content == null) {                            _response.setHeader("Content-Length","0"); // update the header                        } else {                            _response.setHeader("Content-Length", Integer.toString(content.length));                        }                    }                    _response = r;                } catch (Exception e) {                    System.err.println("Error parsing the rawTextArea, abandoning changes : " + e);                }            }            invalidatePanels();            _upToDate[panel] = true;        }    }