Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

javadoc: Explicit link to package without package-info.java does not work #1579

Open
stephan-herrmann opened this issue Aug 10, 2024 · 2 comments

Comments

@stephan-herrmann
Copy link
Contributor

Found during #1472: within javadoc an explicit link to a package only works when package-info.java exists. Implicit links "work", though.

/**
 * See package {@link java.util} or {@link java.util.List}
 */
public class Javadoc {
}

The link {@link java.util} does not navigate anywhere.

Navigating first to java.util.List shows the qualified name whose segment util lets me navigate to the package (albeit signaling "Note: The Javadoc for this element could neither be found in the attached source nor the attached Javadoc.").

In https://openjdk.org/jeps/467, however, I learned that such package links should work.

@caldy2000
Copy link

hello, i tried to write a comment on a method.

	/**
	 * 通过反射创建新的实例。
	 * 如果想通过反射创建新的实例,在jdk9之后,使用{@link Constructor#newInstance(Object...) newInstance}来创建
	 * 
	 * and redirect to {@link java.lang.Object}, and to {@link java.lang}
	 */
	public void createNewInstance() {
		
	}

run command line :

 H:\dev\java\jdk11\bin\javadoc.exe -encoding utf-8 -charset utf-8 -d .\bin\javadoc\ -cp .\src -link 'https://docs.oracle.com/en/java/javase/11/docs/api/' javadoc

this is project's layout:
image

open method's javadoc in browser:
image

link can redirect as expected whether it's class member or package reference, but eclipse java editor can't give a hyperlink on a package reference, class member reference works.

Reference

@stephan-herrmann
Copy link
Contributor Author

eclipse java editor can't give a hyperlink on a package reference, class member reference works.

exactly, that's what this issue is about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants