Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Java
  3. Question
Java

Is repeating javadocs links to file a bad practice?

Asked by Amit Verma Oct 14, 2022 879 views 2 answers
Share

About this question

I'm currently writing an API and its documentation. For example I have something like this:

public interface Event {
}
public interface Process {
}
public interface EventProcessor {
    /**
     * Starts to process the specified event asynchronously. The returned
     * {@link Process} can be used to track progress on the processing. If the
     * specified event causes more {@link Event events} to be processed in this
     * system, then they are also tracked via the returned {@link Process}.
     * 
     * @param event
     *            to be started to process
     * @return
     */
    Process startProcessing(Event event);
}

In the example above, the javadoc link to the interface Process is repeated. In the API I'm writing there are cases where I have several more references to the same class in a single javadoc comment.

Should I always mark references to the class/method/etc. as javadoc links?

Generally, I think having many links in a javadoc comment is a sign for high cohesion. But when it's often the same target, which is linked, I'm not sure if this is good.

Your answer

2 Answers

Shyla Treedove Latest answer

Answered on Oct 30, 2025

A truly diverse programming language offers a wide range of experiences, such as Python, C++, Scratch, or Java. Each program offers simple or advanced expertise. Conquer and challenge yourself to create Scratch Games together.

Was this helpful?

More Java discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Java Blogs

Guides, tips and career advice on Java from JanBask experts.