keith       01/05/21 08:07:24

  Modified:    src/share/org/apache/tomcat/util/buf DateTool.java
  Log:
  There is a lingering bug in (at least) Sun's JDK
  that causes SimpleDateFormat to occasionaly throw a
  StringIndexOutOfBoundsException instead of a
  ParseException.
  
  <http://developer.java.sun.com/developer/bugParade/bugs/4212077.html>
  
  Revision  Changes    Path
  1.2       +4 -2      
jakarta-tomcat/src/share/org/apache/tomcat/util/buf/DateTool.java
  
  Index: DateTool.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/buf/DateTool.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DateTool.java     2001/02/20 03:12:13     1.1
  +++ DateTool.java     2001/05/21 15:07:17     1.2
  @@ -137,17 +137,19 @@
               date = DateTool.rfc1123Format.parse(dateString);
            return date.getTime();
        } catch (ParseException e) { }
  +          catch (StringIndexOutOfBoundsException e) { }
        
           try {
            date = DateTool.rfc1036Format.parse(dateString);
            return date.getTime();
        } catch (ParseException e) { }
  +          catch (StringIndexOutOfBoundsException e) { }
        
           try {
               date = DateTool.asctimeFormat.parse(dateString);
            return date.getTime();
  -        } catch (ParseException pe) {
  -        }
  +        } catch (ParseException pe) { }
  +          catch (StringIndexOutOfBoundsException e) { }
        String msg = sm.getString("httpDate.pe", dateString);
        throw new IllegalArgumentException(msg);
       }
  
  
  

Reply via email to