Ticket #567: ClassUtil.java.diff

File ClassUtil.java.diff, 863 bytes (added by base, 15 years ago)

ClassUtil?.java diff

  • src/core/net/sf/basedb/util/ClassUtil.java

    old new  
    5151    @return A constructor object or null if no constructor was found
    5252  */
    5353  @SuppressWarnings({"unchecked"})
    54   public static <I> Constructor<I> findConstructor(Class<I> clazz, Object[] parameters)
     54  public static <I> Constructor<? extends I> findConstructor(Class<I> clazz, Object[] parameters)
    5555  {
    56     Constructor<I>[] all = clazz.getDeclaredConstructors();
    57     for (Constructor<I> c : all)
     56    Constructor<?>[] all = clazz.getDeclaredConstructors();
     57    for (Constructor<?> c : all)
    5858    {
    5959      if (isAssignable(c.getParameterTypes(), parameters))
    6060      {
    61         return c;
     61        return (Constructor<? extends I>) c;
    6262      }
    6363    }
    6464    return null;