title: NoSuchMethodException when reflecting on method with generic type paremeter
body: <p>I found i have problems when reflecting on a method with generic type paremeter, but the same code works fine with method without generic type paremeter! Here's my code :</p>
  
  <pre><code>public class Test {
  
      public static void method1(Integer i) {
      }
  
      public static void method2(List&lt;Integer&gt; i) {
      }
  
      public static void main(String[] args) throws Exception {
  
          Integer i = 5;
          List&lt;Integer&gt; iList = new ArrayList&lt;Integer&gt;();
          Method method1 = Test.class.getDeclaredMethod("method1", i.getClass());
          method1.invoke(Test.class, i);
          System.err.println("-------- method 1 ok -----------");
          Method method2 = Test.class.getDeclaredMethod("method2", iList.getClass());
          method2.invoke(Test.class, iList);
          System.err.println("-------- method 2 ok -----------");
      }
  
  }
  </code></pre>
  
  <p>And the output:</p>
  
  <pre><code>-------- method 1 ok -----------
  Exception in thread "main" java.lang.NoSuchMethodException: 
  Test.method2(java.util.ArrayList)
      at java.lang.Class.getDeclaredMethod(Class.java:1954)
      at Test.main(Test.java:24)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
  </code></pre>
  
  <p>Is there anything magic with generic type paremeter ??</p>