Invokable.java 文件源码

java
阅读 85 收藏 0 点赞 0 评论 0

项目:googles-monorepo-demo 作者:
/**
 * {@inheritDoc}
 *
 * {@code [<E>]} will be returned for ArrayList's constructor. When both the class and the
 * constructor have type parameters, the class parameters are prepended before those of the
 * constructor's. This is an arbitrary rule since no existing language spec mandates one way or
 * the other. From the declaration syntax, the class type parameter appears first, but the call
 * syntax may show up in opposite order such as {@code new <A>Foo<B>()}.
 */
@Override
public final TypeVariable<?>[] getTypeParameters() {
  TypeVariable<?>[] declaredByClass = getDeclaringClass().getTypeParameters();
  TypeVariable<?>[] declaredByConstructor = constructor.getTypeParameters();
  TypeVariable<?>[] result =
      new TypeVariable<?>[declaredByClass.length + declaredByConstructor.length];
  System.arraycopy(declaredByClass, 0, result, 0, declaredByClass.length);
  System.arraycopy(
      declaredByConstructor, 0,
      result, declaredByClass.length,
      declaredByConstructor.length);
  return result;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号