<commit_before><?php
/* This class is part of the XP framework
 *
 * $Id$
 */

  uses('org.apache.HttpScriptletResponse');

  /**
   * Defines an exception which is thrown inside an HttpScriptlet
   * when it encounters a fatal error situation.
   *
   * These might be
   * <ul>
   *   <li>Session initialization fails</li>
   *   <li>HTTP method is not supported (e.g., DELETE)</li>
   *   <li>Request processing fails with an Exception</li>
   * </ul>
   *
   * @see      xp://org.apache.HttpScriptlet#process
   * @purpose  Exception
   */  
  class HttpScriptletException extends Exception {
    var
      $response;
      
    /**
     * Constructor
     *
     * @access  public
     * @param   string message
     * @param   int statusCode default HTTP_INTERNAL_SERVER_ERROR
     */
    function __construct($message, $statusCode= HTTP_INTERNAL_SERVER_ERROR) {
      parent::__construct($message);
      $this->_response($statusCode);
    }
    
    /**
     * Retrieve response
     *
     * @access  public
     * @return  org.apache.HttpScriptletResponse response object
     */
    function &getResponse() {
      return $this->response;
    }
    
    /**
     * Create the response object
     *
     * @access  private
     * @param   int statusCode
     */
    function _response($statusCode) {
      $this->response= &new HttpScriptletResponse();
      $this->response->statusCode= $statusCode;
      $this->response->setContent(sprintf(
        "<h1>Internal Server Error</h1>\n<xmp>\n%s</xmp>\n",
        $this->toString()
      ));
    }
  }
?>
<commit_msg>- Use HttpScriptletResponse::setStatus() instead of   accessing the member variable itself<commit_after><?php
/* This class is part of the XP framework
 *
 * $Id$
 */

  uses('org.apache.HttpScriptletResponse');

  /**
   * Defines an exception which is thrown inside an HttpScriptlet
   * when it encounters a fatal error situation.
   *
   * These might be
   * <ul>
   *   <li>Session initialization fails</li>
   *   <li>HTTP method is not supported (e.g., DELETE)</li>
   *   <li>Request processing fails with an Exception</li>
   * </ul>
   *
   * @see      xp://org.apache.HttpScriptlet#process
   * @purpose  Exception
   */  
  class HttpScriptletException extends Exception {
    var
      $response;
      
    /**
     * Constructor
     *
     * @access  public
     * @param   string message
     * @param   int statusCode default HTTP_INTERNAL_SERVER_ERROR
     */
    function __construct($message, $statusCode= HTTP_INTERNAL_SERVER_ERROR) {
      parent::__construct($message);
      $this->_response($statusCode);
    }
    
    /**
     * Retrieve response
     *
     * @access  public
     * @return  org.apache.HttpScriptletResponse response object
     */
    function &getResponse() {
      return $this->response;
    }
    
    /**
     * Create the response object
     *
     * @access  private
     * @param   int statusCode
     */
    function _response($statusCode) {
      $this->response= &new HttpScriptletResponse();
      $this->response->setStatus($statusCode);
      $this->response->setContent(sprintf(
        "<h1>Internal Server Error</h1>\n<xmp>\n%s</xmp>\n",
        $this->toString()
      ));
    }
  }
?>

{'fraction_non_alphanumeric': 0.1238390092879257, 'fraction_numerical': 0.001238390092879257, 'mean_word_length': 2.39390756302521, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6715172', 'n_tokens_mistral': 976, 'n_tokens_neox': 968, 'n_words': 224}