如何理解这个Javadoc“;“未找到引用”;错误?

如何理解这个Javadoc“;“未找到引用”;错误?,java,javadoc,Java,Javadoc,TLDR:问题在底部 考虑这样一个场景: a/a.java package a; /** A class designed for inheritance. */ public class A { /** An amazing enum! */ protected enum AEnum { /** A wonderful value. */ A1, /** A marvellous value. */ A2 } /** * Subcla

TLDR:问题在底部

考虑这样一个场景:

a/a.java

package a;

/** A class designed for inheritance. */
public class A {

  /** An amazing enum! */
  protected enum AEnum {
    /** A wonderful value. */
    A1,
    /** A marvellous value. */
    A2
  }

  /**
   * Subclasses can call this constructor.
   *
   * @param ae may very well be {@link AEnum#A1}!
   */
  protected A(AEnum ae) { }

};
package b;
import a.A;

/** My second class, so happy! */
public class B {

  /**
   * A constructor of {@link B}, takes an instance of {@link A}.
   * Maybe I want to say that something depends on whether
   * {@code aInstance} was constructed with {@link a.A.AEnum#A1}?
   *
   * @param aInstance (hmm, what could {@code aInstance} be? ;-)
   */
  public B(A aInstance) { }

};
b/b.java

package a;

/** A class designed for inheritance. */
public class A {

  /** An amazing enum! */
  protected enum AEnum {
    /** A wonderful value. */
    A1,
    /** A marvellous value. */
    A2
  }

  /**
   * Subclasses can call this constructor.
   *
   * @param ae may very well be {@link AEnum#A1}!
   */
  protected A(AEnum ae) { }

};
package b;
import a.A;

/** My second class, so happy! */
public class B {

  /**
   * A constructor of {@link B}, takes an instance of {@link A}.
   * Maybe I want to say that something depends on whether
   * {@code aInstance} was constructed with {@link a.A.AEnum#A1}?
   *
   * @param aInstance (hmm, what could {@code aInstance} be? ;-)
   */
  public B(A aInstance) { }

};
Javadoc抱怨这一行:

src/b/B.java:10: error: reference not found
   * {@code aInstance} was constructed with {@link a.A.AEnum#A1}?
                                                   ^
但在编译的HTML中,无论如何都会创建一个到相应的
enum
值的正确链接。我对这个错误感到困惑,既然找到了,为什么要将引用报告为“未找到”

当然,现在想引用
protected
元素是很奇怪的,我的
B
没有访问权限,但这不是代码,只是一个文档。我相信在某些情况下这是合理的。我在定义一个未检查的异常(将所有异常保留在一个单独的包中)时遇到了这种情况,并解释说,如果原始类的
受保护的
构造函数在某些特定设置下被调用,并且违反了约定,就会抛出该异常。我读到我不应该在构造函数的文档中放置一个
@throw
,那么除了在异常中,还有什么地方可以描述错误条件呢

我说的不是格式错误的
@link
或其他什么,而是“只是”关于访问违规的警告,对吗?还是应该用不同的格式?这是预期的行为吗