@Override
    public Date parseTime(String input) throws ParseException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "parseTime parsing [" + input + "]");
        }
        String data = input;
        int i = data.indexOf(';', 0);
        // PK20062 - check for excess data following the date value
        if (-1 != i) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Ignoring excess data following semi-colon in date");
            }
            // strip off trailing whitespace before semi-colon
            for (; i > 20; i--) {
                char c = data.charAt(i - 1);
                if (' ' != c && '\t' != c) {
                    break;
                }
            }
            if (20 >= i) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Not enough data left to make a valid date");
                }
                throw new ParseException("Invalid date [" + input + "]", 0);
            }
            data = input.substring(0, i);
        }

        Date parsedDate = attemptParse(getFormat().get1123Parse(), data);
        if (null == parsedDate) {
            parsedDate = attemptParse(getFormat().get1036Parse(), data);
            if (null == parsedDate) {
                parsedDate = attemptParse(getFormat().getAsciiParse(), data);
                if (null == parsedDate) {
                    parsedDate = attemptParse(getFormat().get2109Parse(), data);
                    if (null == parsedDate) {
                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                            Tr.debug(tc, "Time does not match supported formats");
                        }
                        throw new ParseException("Unparseable [" + data + "]", 0);
                    }
                }
            }
        }
        return parsedDate;
    }
@ Override public Date parseTime ( String input ) throws ParseException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "parseTime parsing [" + input + "]" ) ; } String data = input ; int i = data . indexOf ( ';' , 0 ) ; if ( - 1 != i ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Ignoring excess data following semi-colon in date" ) ; } for ( ; i > 20 ; i -- ) { char c = data . charAt ( i - 1 ) ; if ( ' ' != c && '\t' != c ) { break ; } } if ( 20 >= i ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Not enough data left to make a valid date" ) ; } throw new ParseException ( "Invalid date [" + input + "]" , 0 ) ; } data = input . substring ( 0 , i ) ; } Date parsedDate = attemptParse ( getFormat ( ) . get1123Parse ( ) , data ) ; if ( null == parsedDate ) { parsedDate = attemptParse ( getFormat ( ) . get1036Parse ( ) , data ) ; if ( null == parsedDate ) { parsedDate = attemptParse ( getFormat ( ) . getAsciiParse ( ) , data ) ; if ( null == parsedDate ) { parsedDate = attemptParse ( getFormat ( ) . get2109Parse ( ) , data ) ; if ( null == parsedDate ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Time does not match supported formats" ) ; } throw new ParseException ( "Unparseable [" + data + "]" , 0 ) ; } } } } return parsedDate ; }
/*
@see com.ibm.websphere.http.HttpDateFormat#parseTime(java.lang.String)