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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
