commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsde...@apache.org
Subject cvs commit: jakarta-commons/httpclient/src/java/org/apache/commons/httpclient HeaderElement.java
Date Wed, 07 Aug 2002 03:04:01 GMT
jsdever     2002/08/06 20:04:01

  Modified:    httpclient/src/java/org/apache/commons/httpclient
                        HeaderElement.java
  Log:
  Minor fix to prevent ',' from being dropped from date parsing.
  Suggested by: David Green
  
  Revision  Changes    Path
  1.11      +10 -13    jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HeaderElement.java
  
  Index: HeaderElement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HeaderElement.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- HeaderElement.java	28 Jul 2002 18:08:57 -0000	1.10
  +++ HeaderElement.java	7 Aug 2002 03:04:01 -0000	1.11
  @@ -254,8 +254,8 @@
        * @throws HttpException if the above syntax rules are violated.
        */
       public final static HeaderElement[] parse(String headerValue)
  -        throws HttpException {
  -	 log.trace("enter HeaderElement.parse(String)");
  +    throws HttpException {
  +        log.trace("enter HeaderElement.parse(String)");
   
           if (headerValue == null) {
               return null;
  @@ -271,8 +271,7 @@
               // FIXME: refactor into private method named ?
               // careful... there may have been a comma in a quoted string
               try {
  -                while (HeaderElement.hasOddNumberOfQuotationMarks(
  -                       nextToken)) {
  +                while (HeaderElement.hasOddNumberOfQuotationMarks(nextToken)) {
                       nextToken += "," + tokenizer.nextToken();
                   }
               } catch (NoSuchElementException exception) {
  @@ -305,7 +304,7 @@
                           nextToken.endsWith("Saturday") ||
                           nextToken.endsWith("Sunday" )) {
   
  -                        nextToken += tokenizer.nextToken(",");
  +                        nextToken += "," + tokenizer.nextToken();
                       }
                   }
               } catch (NoSuchElementException exception) {
  @@ -372,8 +371,6 @@
        *      otherwise
        */
       private final static boolean hasOddNumberOfQuotationMarks(String string) {
  -	 log.trace("enter HeaderElement.hasOddNumberOfQuotationMarks(String)");
  -
           boolean odd = false;
           int start = -1;
           while ((start = string.indexOf('"', start+1)) != -1) {
  @@ -391,14 +388,14 @@
        * @return a {@link NameValuePair} representing the header
        */
       private final static NameValuePair parsePair(char[] header, int start, int end) {
  -	 log.trace("enter HeaderElement.parsePair(char[], int, int)");
  +        log.trace("enter HeaderElement.parsePair(char[], int, int)");
   
           boolean done = false;
           NameValuePair pair = null;
           String name = new String(header, start, end - start).trim();
           String value = null;
   
  -	//TODO: This would certainly benefit from a StringBuffer
  +        //TODO: This would certainly benefit from a StringBuffer
           int index = name.indexOf("=");
           if (index >= 0) {
               if ((index + 1) < name.length()) {
  
  
  

--
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