Skip to content

Reposition Example Usage sections above @param/@return in JavaDoc#36

Merged
mercyblitz merged 1 commit into
mainfrom
copilot/modify-javadoc-example-usage-position
May 30, 2026
Merged

Reposition Example Usage sections above @param/@return in JavaDoc#36
mercyblitz merged 1 commit into
mainfrom
copilot/modify-javadoc-example-usage-position

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 30, 2026

JavaDoc comments in logging modules had Example Usage sections positioned after parameter documentation, reducing readability. Reorganized 14 files to place Example Usage code examples above @param/@return tags for better documentation flow.

Changes

  • Log4j adapter: Log4jLogger.java
  • Log4j2 adapter: Log4j2Logger.java, LogEventComparator.java, InMemoryAppender.java, layout utilities, and Log4j2Utils.java
  • Commons & Test: LoggingMXBeanAdapter.java and 6 test infrastructure files

Example

// Before
/**
 * Creates a new {@link Log4j2Logger} for the given logger name.
 *
 * @param loggerName the name of the logger
 *
 * <h3>Example Usage</h3>
 * <pre>{@code
 *   Log4j2Logger logger = new Log4j2Logger("io.microsphere");
 * }</pre>
 */

// After
/**
 * Creates a new {@link Log4j2Logger} for the given logger name.
 *
 * <h3>Example Usage</h3>
 * <pre>{@code
 *   Log4j2Logger logger = new Log4j2Logger("io.microsphere");
 * }</pre>
 * @param loggerName the name of the logger
 */

Documentation structure unchanged; formatting preserved.

Copilot AI changed the title Move Example Usage sections above @param/@return in JavaDoc Reposition Example Usage sections above @param/@return in JavaDoc May 30, 2026
Copilot AI requested a review from mercyblitz May 30, 2026 09:59
@mercyblitz mercyblitz marked this pull request as ready for review May 30, 2026 09:59
@codecov
Copy link
Copy Markdown

codecov Bot commented May 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ Complexity Δ
...java/io/microsphere/logging/log4j/Log4jLogger.java 100.00% <ø> (ø) 17.00 <0.00> (ø)
...va/io/microsphere/logging/log4j2/Log4j2Logger.java 100.00% <ø> (ø) 17.00 <0.00> (ø)
...microsphere/logging/log4j2/LogEventComparator.java 100.00% <ø> (ø) 3.00 <0.00> (ø)
...here/logging/log4j2/appender/InMemoryAppender.java 100.00% <ø> (ø) 13.00 <0.00> (ø)
...sphere/logging/log4j2/layout/DelegatingLayout.java 100.00% <ø> (ø) 11.00 <0.00> (ø)
...logging/log4j2/layout/SmartFileAppenderLayout.java 41.30% <ø> (ø) 11.00 <0.00> (ø)
...o/microsphere/logging/log4j2/util/Log4j2Utils.java 100.00% <ø> (ø) 33.00 <0.00> (ø)
.../microsphere/logging/jmx/LoggingMXBeanAdapter.java 100.00% <ø> (ø) 12.00 <0.00> (ø)
...osphere/logging/test/junit4/LoggingLevelsRule.java 100.00% <ø> (ø) 3.00 <0.00> (ø)
...re/logging/test/junit4/LoggingLevelsStatement.java 100.00% <ø> (ø) 4.00 <0.00> (ø)
... and 4 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mercyblitz mercyblitz merged commit f7894ed into main May 30, 2026
6 checks passed
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 30, 2026

🤖 Augment PR Summary

Summary: Improves JavaDoc readability by moving “Example Usage” sections above the @param/@return tag blocks across the logging modules.

Changes:

  • Reordered constructor JavaDocs in Log4j and Log4j2 logger adapters so examples appear before parameter documentation.
  • Adjusted method JavaDocs in Log4j2 support code (e.g., comparator, in-memory appender, layouts, and `Log4j2Utils`) to keep examples close to the main narrative.
  • Applied the same documentation flow to the commons JMX adapter (`LoggingMXBeanAdapter`).
  • Aligned JUnit4/JUnit5 test infrastructure JavaDocs to use the same structure for consistency.

Technical Notes: This PR changes documentation ordering/whitespace only; no runtime logic is modified.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

* <pre>{@code
* Log4jLogger logger = new Log4jLogger("io.microsphere");
* }</pre>
* @param loggerName the name of the logger
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 30, 2026

Choose a reason for hiding this comment

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

Note: .github/scripts/generate-wiki-docs.py treats the Javadoc description as everything before the first @ tag; moving the <h3>Example Usage</h3>/<pre> block above @param will now include that HTML in method.description and may duplicate or awkwardly render examples in generated wiki docs.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@mercyblitz mercyblitz deleted the copilot/modify-javadoc-example-usage-position branch May 30, 2026 10:43
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

Successfully merging this pull request may close these issues.

2 participants