title: varargs and null argument
body: <p>So, I have a weird issue.
  This expression: <code>method.invoke(target, null)</code> throws java.lang.IllegalArgumentException: wrong number of arguments</p>
  
  <p>The problem is that this expression is deep inside hibernate (BasicPropertyAccessor$BasicGetter to be precise) and I guess it should work fine (it did until recently)</p>
  
  <p>I debugged this problem in eclipse and indeed, if I (in Display view) call <code>method.invoke(target)</code> or <code>method.invoke(target, (Object[]) null)</code> everything works fine.
  I'm sure my class has this getter and it has no arguments. So ... the question is, what the hell is going on?!</p>
  
  <p>EDIT:</p>
  
  <ul>
  <li>method is an instance of java.lang.reflect.Method and points to the said getter</li>
  <li>target is an instance of the class with public X getX() getter</li>
  <li>JDK 1.6.0_31</li>
  <li><p>code in hibernate (BasicPropertyAccessor:143) :</p>
  
  <pre><code>public Object get(Object target) throws HibernateException {
      try {
          return method.invoke(target, null);
      }
      catch{ ... }
  }
  </code></pre></li>
  </ul>