Hi Jerome,

[...]
> One issue I'm having is that the Restlet interface is implemented by many
> classes (connectors, components, etc.). The changes suggested trigger a
> cascade of other changes in order to prevent warnings like:

> "Type safety: The method handle(Call) belongs to the raw type Restlet.
> References to generic type 
>  Restlet<T> should be parameterized "

Okay, another try. I think the Restlet<T extends Call> is too much.

How about this:

    // Leave Restlet as it is
    public interface Restlet {
           public void handle(Call call);

           // ...
    }


    public abstract class AbstractRestlet<T extends Call>
                                            implements Restlet {

          @SuppressWarnings("unchecked")
           public void handle(Call call) {
              if (call.getMethod.equals(...)) {
                 handleGet((T) call);
              }
              // ...
           }

           public void handleGet(T call) {
              // ...
           }
    }

Does this solution help? Or do several classes depend on
AbstractRestlet?

Best regards,
Lars
-- 
http://semagia.com

Reply via email to