如果它们具有Bonded类型参数,如何在javadoc的@see和@link中引用方法?

例:

public class A { }
public interface I<J> { }

public class F {
    public static <T extends A & I<B>, B> String newThing(T bondedTypeObject, List<B> list) {
      /*...*/
    }

    public static <T extends A & I<B>, B> String newThing(T bondedTypeObject, B anotherObject) {
      /*...*/
    }


    /**
     * Uses {@link #newThing(T bondedTypeObject, List<B> list) newThing} to create a super new thing.
     */
    public static String createSuperNewThing(...) {
       return newThing(...);
    }
}

您如何编写createSuperNewThing链接的Javadoc到正确的newThing方法?

在以下情况下,Oracle文档不是很清楚:
http://docs.oracle.com/javase/6/docs/technotes/tools/windows/javadoc.html#specifyingname

最佳答案

您需要指定参数的erasure,例如:

/**
 * Uses {@link newThing(A bondedTypeObject, List list)} to create...
 */

注意,类型参数T extends SomeClass & SomeInterface的擦除是SomeClass

07-28 13:57