Skip to content

#3588 Use <pre><code class='java'> consistently for code examples in Javadoc - #4159

Open
Maver4ck wants to merge 1 commit into
mapstruct:mainfrom
Maver4ck:3588
Open

Maver4ck wants to merge 1 commit into
mapstruct:mainfrom
Maver4ck:3588

Conversation

@Maver4ck

@Maver4ck Maver4ck commented Nov 24, 2026 •

Copy link
Copy Markdown

Fixes #3588

Changes

  • Use <pre><code class='java'> for the remaining Java code examples in the Javadoc: the core annotations, Mappers, the DefaultBuilderProvider SPI and the processor classes SourceReference, TargetReference and LifecycleOverloadDeduplicateSelector.
  • In ValueMapping, put the code examples and the result tables in separate blocks, and remove the invalid trailing commas after the @ValueMapping annotations.

…xamples in Javadoc

Align the remaining Java code examples in the published Javadoc (core
annotations, `Mappers`, the `DefaultBuilderProvider` SPI and the processor
classes `SourceReference`, `TargetReference` and
`LifecycleOverloadDeduplicateSelector`) with the `<pre><code class='java'>` form
that is already used by most of the annotations, so that IDEs like IntelliJ
render them as Java code.

In `ValueMapping` the code examples are separated from their mapping results:
the result tables are moved into their own `<pre>` blocks, the error message of
the last example is moved out of the code block, and the invalid trailing commas
after the repeated `@ValueMapping` annotations are removed.

Blocks that do not contain Java code (grammar and pseudo-notation in
`MethodMatcher` and `Type`) are intentionally left as plain `<pre>`.
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.

Improve usage of <pre><code> in Javadoc

1 participant