private static CharSequence validName(final CharSequence name) {
        if (!RsWithCookie.CNAME_PTRN.matcher(name).matches()) {
            throw new IllegalArgumentException(
                String.format(
                    "Cookie name \"%s\" contains invalid characters",
                    name
                )
            );
        }
        return name;
    }
private static CharSequence validName ( final CharSequence name ) { if ( ! RsWithCookie . CNAME_PTRN . matcher ( name ) . matches ( ) ) { throw new IllegalArgumentException ( String . format ( "Cookie name \"%s\" contains invalid characters" , name ) ) ; } return name ; }
Checks name according RFC 2616, section 2.2.
@param name Cookie name;
@return Cookie name