You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by mb...@apache.org on 2003/05/12 03:17:50 UTC

cvs commit: jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods HeadMethod.java

mbecke      2003/05/11 18:17:50

  Modified:    httpclient/src/java/org/apache/commons/httpclient
                        HttpStatus.java
               httpclient/src/java/org/apache/commons/httpclient/methods
                        HeadMethod.java
  Log:
  Fixed some checkstyle violations.  Removed tab characters, reformatted, etc.
  
  Revision  Changes    Path
  1.15      +20 -23    jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpStatus.java
  
  Index: HttpStatus.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpStatus.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- HttpStatus.java	8 May 2003 18:39:07 -0000	1.14
  +++ HttpStatus.java	12 May 2003 01:17:49 -0000	1.15
  @@ -83,18 +83,16 @@
       // -------------------------------------------------------- Class Variables
   
       /** Reason phrases lookup table. */
  -    private static final String[][] ReasonPhrases = new String[][]{
  -    	new String[0],
  -    	new String[3],
  -    	new String[8],
  -    	new String[8],
  -    	new String[25],
  -    	new String[8]
  +    private static final String[][] REASON_PHRASES = new String[][]{
  +        new String[0],
  +        new String[3],
  +        new String[8],
  +        new String[8],
  +        new String[25],
  +        new String[8]
       };
   
   
  -
  -
       // --------------------------------------------------------- Public Methods
   
       /**
  @@ -110,15 +108,14 @@
        * TODO: getStatusText should be called getReasonPhrase to match RFC
        */
       public static String getStatusText(int statusCode) {
  -		
  -		int classIndex = statusCode/100;
  -		int codeIndex = statusCode-classIndex*100;
  -		if (classIndex < 1 || classIndex > ReasonPhrases.length-1 || 
  -		    codeIndex < 0 || codeIndex > ReasonPhrases[classIndex].length)
  -			return null;
  -		return ReasonPhrases[classIndex][codeIndex];
   
  -		
  +        int classIndex = statusCode / 100;
  +        int codeIndex = statusCode - classIndex * 100;
  +        if (classIndex < 1 || classIndex > (REASON_PHRASES.length - 1) 
  +            || codeIndex < 0 || codeIndex > REASON_PHRASES[classIndex].length) {
  +            return null;
  +        }
  +        return REASON_PHRASES[classIndex][codeIndex];
       }
   
   
  @@ -130,8 +127,8 @@
        * @param reasonPhrase The reason phrase for this status code
        */
       private static void addStatusCodeMap(int statusCode, String reasonPhrase) {
  -        int classIndex = statusCode/100;
  -        ReasonPhrases[classIndex][statusCode-classIndex*100] = reasonPhrase;
  +        int classIndex = statusCode / 100;
  +        REASON_PHRASES[classIndex][statusCode - classIndex * 100] = reasonPhrase;
       }
   
   
  
  
  
  1.19      +11 -10    jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods/HeadMethod.java
  
  Index: HeadMethod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods/HeadMethod.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- HeadMethod.java	8 May 2003 17:33:52 -0000	1.18
  +++ HeadMethod.java	12 May 2003 01:17:49 -0000	1.19
  @@ -187,24 +187,25 @@
           }
   
       }
  -	/**
  +    
  +    /**
        * Return non-compliant response body check timeout.
        * 
  -	 * @return The period of time in milliseconds to wait for a response 
  +     * @return The period of time in milliseconds to wait for a response 
        *         body from a non-compliant server. <tt>-1</tt> returned when 
        *         non-compliant response body check is disabled
  -	 */
  +     */
       public int getBodyCheckTimeout() {
           return this.bodyCheckTimeout;
       }
   
  -	/**
  +    /**
        * Set non-compliant response body check timeout.
        * 
  -	 * @param timeout The period of time in milliseconds to wait for a response 
  +     * @param timeout The period of time in milliseconds to wait for a response 
        *         body from a non-compliant server. <tt>-1</tt> can be used to 
        *         disable non-compliant response body check 
  -	 */
  +     */
       public void setBodyCheckTimeout(int timeout) {
           this.bodyCheckTimeout = timeout;
       }
  
  
  

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