commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jeri...@apache.org
Subject cvs commit: jakarta-commons/httpclient/src/java/org/apache/commons/httpclient URIException.java
Date Wed, 09 Oct 2002 12:46:16 GMT
jericho     2002/10/09 05:46:16

  Modified:    httpclient/src/java/org/apache/commons/httpclient
                        URIException.java
  Log:
  - Add the getReason method
    Throwable doesn't support setMessage() method (only getMessage) or protected variable
instance. So it has the own message treat method.
  
  Revision  Changes    Path
  1.2       +35 -6     jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/URIException.java
  
  Index: URIException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/URIException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- URIException.java	22 Sep 2002 05:19:50 -0000	1.1
  +++ URIException.java	9 Oct 2002 12:46:16 -0000	1.2
  @@ -103,7 +103,8 @@
        * @param reason the reason
        */
       public URIException(int reasonCode, String reason) {
  -        super(reason);
  +        super(reason); // for backward compatibility of Throwable
  +        this.reason = reason;
           setReasonCode(reasonCode);
       }
   
  @@ -114,7 +115,8 @@
        * @param reason the reason
        */
       public URIException(String reason) {
  -        super(reason);
  +        super(reason); // for backward compatibility of Throwable
  +        this.reason = reason;
           setReasonCode(UNKNOWN);
       }
   
  @@ -147,6 +149,12 @@
        */
       protected int reasonCode;
   
  +
  +    /**
  +     * The reason message.
  +     */
  +    protected String reason;
  +
       // ---------------------------------------------------------------- methods
   
       /**
  @@ -167,6 +175,27 @@
       public void setReasonCode(int reasonCode) {
           this.reasonCode = reasonCode;
       }
  +
  +
  +    /**
  +     * Get the reason message.
  +     *
  +     * @return the reason message
  +     */
  +    public String getReason() {
  +        return reason;
  +    }
  +
  +
  +    /**
  +     * Set the reason message.
  +     *
  +     * @param the reason message
  +     */
  +    public void setReason(String reason) {
  +        this.reason = reason;
  +    }
  +
   
   }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message