Skip to content

documentation/issue-45: Use inline {@return ...} tag for Javadoc summaries missing from the public API - #46

Open
philliplbryant wants to merge 1 commit into
Col-E:masterfrom
philliplbryant:documentation/issue-45
Open

documentation/issue-45: Use inline {@return ...} tag for Javadoc summaries missing from the public API#46
philliplbryant wants to merge 1 commit into
Col-E:masterfrom
philliplbryant:documentation/issue-45

Conversation

@philliplbryant

Copy link
Copy Markdown

Closes #45

  • Text-only change: no method signatures, behavior, or logic were touched.
  • One "Boy Scout" fix: DockBuilding.leaf(String)'s doc had been copy-pasted from branch(String) — corrected while I was already editing.

* Use inline ``{@return ...}`` tag for Javadoc summaries missing from the public API.

/**
* @return Factory for creating {@link PixelCanvas}.
* {@return factory for creating {@link PixelCanvas}}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sentence casing changes, and punctuation in most of the classes changed.

@Col-E

Col-E commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Example I found online:

/**
 * {@return The configuration property value.}
 * If the property does not exist in the system environment, 
 * this method will fallback to checking local properties.
 */
public String getProperty(String key) { ... }

In this case I see why this exists. First sentence becomes the @return.

However if the block is this:

/**
 * {@return The configuration property value.}
 */
public String getProperty(String key) { ... }

Then you just have the same thing twice, once in the summary and once in the @return which doesn't seem useful IMO. All of the changes in this MR are the latter variant which IMO doesn't add any value.

@Col-E Col-E added the documentation Improvements or additions to documentation label Sep 11, 2026
@philliplbryant

philliplbryant commented Sep 11, 2026

Copy link
Copy Markdown
Author

Hi @Col-E ,

In response to your comments, take a look at theJDK 25 source for ZipEntry#getName(), which uses the inline tag:

/**
 * {@return the name of the entry}
 */
public String getName() {
    return name;
}

and compare it to the JavaDocs

Method Summary

image

Method Details

img

Notice the Method Summary table row for getName() reads "Returns the name of the entry.", which was generated from the {@return} text. The Method Detail section below repeats the same under Returns:, which is normal JavaDoc styling (summary sentence + @return tag). This is the JDK's reference implementation of the tag, which I used.

So, what's gained by using {@return}?

  1. A blank cell in the method summary table gets filled in, providing readers information without having to drill down to find it.
  2. More importantly, ignored JavaDoc/doclint warnings get fixed. These changes are meant to eliminate the noise of dozens of warnings now, and eventually stop suppressing JavaDoc warnings altogether, with the ultimate goal of seeing new warnings that might actually matter.

As far as the changes in case and punctuation: fair point, but it's not arbitrary. {@return X} renders as Returns X. — capital "R", then whatever follows has to read as a sentence continuation. {@return Factory for creating...} would render "Returns Factory for creating..." (double-capitalized, reads awkwardly), so the original text got lowercased and de-punctuated to fit grammatically after the auto-prepended "Returns".

It's probably obvious I'm making these changes agentically. I'm happy to continue burning tokens to try to make things "better". If you don't think it's better, let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use inline {@return ...} tag for Javadoc summaries missing from the public API

2 participants