title: Any solution for Class.getMethod() reflection and autoboxing?
body: <p>I want to use</p>
  
  <pre><code>Class.getMethod(String name, Class... parameterTypes)
  </code></pre>
  
  <p>to find the method I need to invoke with the given parameters, but apparently as described in <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6176992" rel="noreferrer">Bug 6176992</a> Java doesn't include autoboxing there. So if my reflected class has a method with a (String, int) signature you still get a NoSuchMethodException with a {String.class, Integer.class} array as a paremeter.</p>
  
  <p>Is there any sollution for this? The only way I could think of to call getMethod() with every permutation of primitive and non primitive types which I don't really want to do.</p>
  
  <p>Edit: To make it more clear: I am well aware of the primitive type classes, but I don't see how they could help to solve my problem. My parameterTypes array comes from somewhere and I know that it will only return non primitive types. I can not assume that the interface will only be declared with primitive types and that's exactly my problem:</p>
  
  <pre><code>public interface TestInterface()
  {
      public void doTest(Integer i1, int i2, double d3, Double d);
  }
  
  Class&lt;?&gt;[] classes = { Integer.class, Integer.class, Double.class, Double.class }
  // Due to autoboxing I should become the doTest method here, but it doesn't work
  TestInterface.class.getMethod("doTest", classes);
  </code></pre>