hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: [jira] Commented: (HTTPCORE-110) refactor message parsing and formatting, step 2
Date Tue, 21 Aug 2007 08:11:23 GMT
On Tue, 2007-08-21 at 08:08 +0200, Roland Weber wrote:
> Oleg Kalnichevski (JIRA) wrote:
> > Could you please avoid using RuntimeException in the interface declarations
> > and either use a specific type or none at all? Declaring RuntimeException
> > in the throws clause is like saying "shit happens".
> 
> No problem. I was caught by surprise at that point, because the
> parsers for request and status line would throw a ProtocolException
> on parse errors, whereas the parsers for headers would throw a
> RuntimeException. Declaring the RuntimeException was the quickest
> hack to document how parse errors are reported.
> 
> I'll change the parsers, including the constructor of BufferedHeader,
> to throw a ProtocolException instead. That will also show up in
> Header.getElements(), which probably affects the cookie code.
> 
> Btw, is it intentional that both implementations of Header.getElements
> will repeat the parsing for each invocation instead of caching the
> result?
> 

Yes, this is intentional. It is a trade-off between caching data that
may never be used and repeating the parsing run in case the header
value / elements are accessed more than once. In my opinion the former
is way more frequent. 

Oleg

> cheers,
>   Roland
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org
> 
> 


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


Mime
View raw message