title: Wrong number of arguments on method.invoke
body: <p>I currently have this code:</p>
  
  <pre><code>public class Pants {
      public static void main(String[] args) {
          Pants pants = new Pants();
          pants.eat(10, 10.3, "Nice.");
  
          Object[] params = {(long)10, 10.3, "Nice."};
          Method eatMethod = pants.getClass().getMethods()[0];
          try
          {
              eatMethod.invoke(pants, params);
          } catch (IllegalAccessException | InvocationTargetException e)
          {
              e.printStackTrace();
          }
      }
  
      public void eat(long amount, double size, String name) {
          System.out.println("You ate");
      }
  }
  </code></pre>
  
  <p>It always throws</p>
  
  <pre><code>IllegalArgumentException: wrong number of arguments.
  </code></pre>
  
  <p>This happened with other methods too. I used the same parameters in <code>eat()</code> as in <code>method.invoke</code>, and the types are the same. The error is thrown on </p>
  
  <pre><code>eatMethod.invoke(pants, params);
  </code></pre>