? HttpClient.iml ? HttpClient.ipr ? HttpClient.iws ? HttpClient_old.ipr ? HttpClient_old.iws ? exception.patch ? lib/junit.jar Index: src/java/org/apache/commons/httpclient/HttpException.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpException.java,v retrieving revision 1.18 diff -u -r1.18 HttpException.java --- src/java/org/apache/commons/httpclient/HttpException.java 13 May 2004 04:03:24 -0000 1.18 +++ src/java/org/apache/commons/httpclient/HttpException.java 30 Sep 2004 01:22:43 -0000 @@ -164,6 +164,71 @@ } } + /** + * Sets the text description of the reason for an exception. + * + * @param reason The reason for the exception. + * + * @deprecated HttpClient no longer uses this for itself. It is only + * provided for compatibility with existing clients, and will be removed + * in a future release. + */ + public void setReason(String reason) { + this.reason = reason; + } + + /** + * Get the text description of the reason for an exception. + * + * @deprecated HttpClient no longer uses this for itself. It is only + * provided for compatibility with existing clients, and will be removed + * in a future release. + */ + public String getReason() { + return reason; + } + + /** + * Sets the status code description of the reason for an exception. + * + * @param code The reason for the exception. This is intended to be an + * HTTP status code. + * + * @deprecated HttpClient no longer uses this for itself. It is only + * provided for compatibility with existing clients, and will be removed + * in a future release. + */ + public void setReasonCode(int code) { + reasonCode = code; + } + + /** + * Get the status code description of the reason for an exception. + * + * @deprecated HttpClient no longer uses this for itself. It is only + * provided for compatibility with existing clients, and will be removed + * in a future release. + */ + public int getReasonCode() { + return this.reasonCode; + } + + /** + * A "reason" string provided for compatibility with older clients. + * + * @deprecated HttpClient no longer uses this field for itself. It + * is only provided for compatibility with existing clients. + */ + private String reason; + + /** + * Reason code for compatibility with older clients. + * + * @deprecated HttpClient no longer uses this field for itself. + * It is only provided for compatibility with existing clients. + */ + private int reasonCode = HttpStatus.SC_OK; + /** The original Throwable representing the cause of this error */ private final Throwable cause; } Index: src/java/org/apache/commons/httpclient/URIException.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/URIException.java,v retrieving revision 1.11 diff -u -r1.11 URIException.java --- src/java/org/apache/commons/httpclient/URIException.java 18 Apr 2004 23:51:35 -0000 1.11 +++ src/java/org/apache/commons/httpclient/URIException.java 30 Sep 2004 01:22:43 -0000 @@ -53,7 +53,7 @@ * @param reasonCode the reason code */ public URIException(int reasonCode) { - setReasonCode(reasonCode); + this.reasonCode = reasonCode; } @@ -66,7 +66,7 @@ public URIException(int reasonCode, String reason) { super(reason); // for backward compatibility of Throwable this.reason = reason; - setReasonCode(reasonCode); + this.reasonCode = reasonCode; } @@ -78,7 +78,7 @@ public URIException(String reason) { super(reason); // for backward compatibility of Throwable this.reason = reason; - setReasonCode(UNKNOWN); + this.reasonCode = UNKNOWN; } // -------------------------------------------------------------- constants @@ -136,11 +136,13 @@ return reasonCode; } - /** * Set the reason code. * * @param reasonCode the reason code + * + * @deprecated Callers should set the reason code as a parameter to the + * constructor. */ public void setReasonCode(int reasonCode) { this.reasonCode = reasonCode; @@ -151,6 +153,8 @@ * Get the reason message. * * @return the reason message + * + * @deprecated You should instead call {@link #getMessage()}. */ public String getReason() { return reason; @@ -161,6 +165,8 @@ * Set the reason message. * * @param reason the reason message + * + * @deprecated Callers should instead set this via a parameter to the constructor. */ public void setReason(String reason) { this.reason = reason;