title: Overriding the generic abstract method of `ParamConvertorProvider`
body: <p>I am providing an implementation of <code>ParamConverterProvider</code> in a JAX-RS application.  This implementation provides gives a definition of the abstract method in the interface with signature as:</p>
  
  <pre><code>public &lt;T&gt; ParamConverter&lt;T&gt; getConverter(Class&lt;T&gt; rawType, Type genericType, Annotation annotations[]);
  </code></pre>
  
  <p>I am playing with an online tutorial and modified the implementation as follows.</p>
  
  <pre><code>package org.koushik.javabrains.rest;
  
  import java.lang.annotation.Annotation;
  import java.lang.reflect.Type;
  import java.util.Calendar;
  
  import javax.ws.rs.ext.ParamConverter;
  import javax.ws.rs.ext.ParamConverterProvider;
  import javax.ws.rs.ext.Provider;
  import org.koushik.javabrains.rest.MyDate;
  @Provider
  public class MyDateConverterProvider implements ParamConverterProvider {
  
      @Override
      public &lt;MyDate&gt; ParamConverter&lt;MyDate&gt; getConverter(final Class&lt;MyDate&gt; rawType, Type genericType, Annotation[] annotations) {
  
              return new ParamConverter&lt;MyDate&gt;() {
  
                  @Override
                  public MyDate fromString(String value) {
  
                      Calendar requestedDate = Calendar.getInstance();
                      if ("tomorrow".equalsIgnoreCase(value)) {
                          requestedDate.add(Calendar.DATE, 1);
                      }
                      else if ("yesterday".equalsIgnoreCase(value)) {
                          requestedDate.add(Calendar.DATE, -1);
                      }
                      org.koushik.javabrains.rest.MyDate myDate = new org.koushik.javabrains.rest.MyDate();
                      myDate.setDate(requestedDate.get(Calendar.DATE));
                      myDate.setMonth(requestedDate.get(Calendar.MONTH));
                      myDate.setYear(requestedDate.get(Calendar.YEAR));
  
                      return rawType.cast(myDate);
                  }
  
                  @Override
                  public String toString(MyDate myBean) {
                      if (myBean == null) {
                          return null;
                      }
                      return myBean.toString();
                  }
              };
  
      }
  
  }
  </code></pre>
  
  <p>I have a few questions:</p>
  
  <ol>
  <li>Why do i need to provide the entire package name when instatiatiating the type T that will be returned from <code>getConverter</code>. It has the same package name as this current class, still I need to write the fully qualified name , else I get a compilation error , cannot instantiate.
  <code>org.koushik.javabrains.rest.MyDate myDate = new org.koushik.javabrains.rest.MyDate();</code>. It doesn't make a difference if I import this at the top. <code>import org.koushik.javabrains.rest.MyDate;</code></li>
  <li>At the start of the method I get this warning <em>The type parameter MyDate is hiding the type MyDate.</em>
  This provider works fine and am able to cast request path params, but am still wondering how can I avoid the above two.</li>
  </ol>