JDK-4809537 : @see and {@link} can't find references
  • Type: Bug
  • Component: tools
  • Sub-Component: javadoc(tool)
  • Affected Version: 1.4.1
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2003-01-28
  • Updated: 2014-05-05
  • Resolved: 2003-02-14
Related Reports
Duplicate :  
Description

Name: rmT116609			Date: 01/28/2003


FULL PRODUCT VERSION :
java version "1.4.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)


FULL OPERATING SYSTEM VERSION :
> rpm --query glibc
glibc-2.2.5-164
> uname -a
Linux jupiter 2.4.19-4GB #1 Fri Sep 13 13:19:15 UTC 2002 i686 unknown

A DESCRIPTION OF THE PROBLEM :
Often @see and {@link} can't find their references.

Write some source, include some @see and {@link} javadoc
tags to reference from a different library, e.g. the Java
API, javadoc linking to it and see what happens.
Some of the references are found, others are not.

The very strange thing is that this bug is reproducable from
the command line, but when javadoc is invoked via ant, this
bug does not occur. I only accidently discovered this bug
when investigating a different bug (@see doesn't create a
link to external references).

But both use the same javadoc from 1.4.1:
chris@jupiter:~/cvs/cvs/JAPI/bugrep> echo $JAVA_HOME
/opt/dist/sun/j2sdk/se/latest
chris@jupiter:~/cvs/cvs/JAPI/bugrep> which javadoc
/opt/dist/sun/j2sdk/se/latest/bin/javadoc
chris@jupiter:~/cvs/cvs/JAPI/bugrep> ls -l $JAVA_HOME
lrwxrwxrwx    1 root     root            9 2002-10-26 13:04
/opt/dist/sun/j2sdk/se/latest -> 1.4.1_01/



STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Type in the attached source code
2. javadoc it using javadoc -link URI-to-Java-API
sourcefilename.

EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected Results:
Documentation is generated without problems.

Actual Results:
javadoc gives 4 warnings that it can't find references.
It can find references to java.awt.TextField but not to
javax.swing.JTextField or javax.swing.text.JTextComponent

ERROR MESSAGES/STACK TRACES THAT OCCUR :
TextComponent.java:11: warning - Tag @link: reference not found:
javax.swing.JTextField
TextComponent.java:11: warning - Tag @see: reference not found:
javax.swing.JTextField
TextComponent.java:23: warning - Tag @see: reference not found:
javax.swing.text.JTextComponent#getText()
TextComponent.java:30: warning - Tag @see: reference not found:
javax.swing.text.JTextComponent#setText(String)


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.awt.event.ActionListener;
import java.awt.event.KeyListener;

/** A simple interface TextComponents should implement.
 * It is used by History to capture commons between {@link java.awt.TextField}
and {@link javax.swing.JTextField}.
 * @author $Author$
 * @version $Revision$
 * @see java.awt.TextField
 * @see javax.swing.JTextField
 */
public interface TextComponent {

    /** Version information */
    static String revision = "$Revision$";

    /** Returns the text contained in this TextComponent.
     * If this TextComponent works with documents and the underlying document is
null, will give a NullPointerException.
     * @see java.awt.TextComponent#getText()
     * @see javax.swing.text.JTextComponent#getText()
     * @return the text
     * @throws NullPointerException if the document is <code>null</code>
     */
    String getText() throws NullPointerException;

    /** Sets the text contained in this TextComponent.
     * @see java.awt.TextComponent#setText(String)
     * @see javax.swing.text.JTextComponent#setText(String)
     * @param t the new text
     */
    void setText(String t);

    // ...
}
---------- END SOURCE ----------
(Review ID: 180352) 
======================================================================

Comments
EVALUATION The links work to java.awt classes that are imported. The links fail to javax.swing classes that are not imported. This is a duplicate of the following bug that was fixed in 1.4.2: 4652655: Fixed @link to link to external -link'd classes This fix greatly simplifies the ability to link to external classes and members. Previously, an external class needed to be either imported or fully qualified in a declaration in order for @see or {@link} to possibly link to its documentation. Now, it is only required that the class be fully qualified; it no longer needs to be imported (which was the previous recommended workaround). ###@###.### 2003-02-14
14-02-2003