That's a bug with the method signature. It should be defined as: public void removeRequestInterceptorByClass(Class<? extends HttpRequestInterceptor> clazz);
Sam On Mon, Mar 10, 2008 at 8:49 AM, Johannes Koch <[EMAIL PROTECTED]> wrote: > Hi, > > I try to remove the HTTP request interceptor RequestAddCookies from the > HTTP client. > > DefaultHttpClient dhc = new DefaultHttpClient(); > dhc.removeRequestInterceptorByClass(RequestAddCookies.class); > > Compiling with Java 1.5 resulted in the following error: > > The method > removeRequestInterceptorByClass(Class<HttpRequestInterceptor>) in the > type AbstractHttpClient is not applicable for the argument > (Class<RequestAddCookies>) > > However, if I use the following code, > > dhc.removeRequestInterceptorByClass( > (Class<HttpRequestInterceptor>) new RequestAddCookies().getClass()); > > I only get a warning. I'm not an expert in Java 1.5 generics; but is > there a way to remove the RequestAddCookies interceptor without first > creating a new instance of RequestAddCookies? > > -- > Johannes Koch > BIKA Web Compliance Center - Fraunhofer FIT > Schloss Birlinghoven, D-53757 Sankt Augustin, Germany > Phone: +49-2241-142628 Fax: +49-2241-142065 > > --------------------------------------------------------------------- > 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]