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

Fix '@' character in javadoc code snippets #3779

Closed
wants to merge 1 commit into from
Closed

Fix '@' character in javadoc code snippets #3779

wants to merge 1 commit into from

Conversation

pigelvy
Copy link
Contributor

@pigelvy pigelvy commented Feb 10, 2023

In the javadoc, the character '@' can be used directly in {@code …}. Using {@literal @} causes wrong formatting of the Java code snippets.

In the javadoc, the character '@' can be used directly in `{@code …}`. Using `{@literal @}` causes wrong formatting of the Java code snippets.
@google-cla
Copy link

google-cla bot commented Feb 10, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@pigelvy
Copy link
Contributor Author

pigelvy commented Feb 10, 2023

If I'm not mistaken about the proper formatting of code snippets, the syntax <pre>{@code …}</pre> should be applied to the javadoc of other annotations.
It should simplify the writting of Java code snippets by getting rid of {@Literal …}.

@eamonnmcmanus
Copy link
Member

Javadoc has had a long-standing bug where a @ was interpreted as starting a tag if it was at the start of the line (after any initial *), even if the @ was inside a multiline {@code} or {@literal}. If we're able to determine that no version of Javadoc we use is affected by that bug anymore, we could potentially make simplifications like this one.

@cushon
Copy link
Collaborator

cushon commented Feb 14, 2023

Javadoc has had a long-standing bug where a @ was interpreted as starting a tag if it was at the start of the line (after any initial *), even if the @ was inside a multiline {@code} or {@literal}. If we're able to determine that no version of Javadoc we use is affected by that bug anymore, we could potentially make simplifications like this one.

That was fixed in JDK 15 (https://bugs.openjdk.org/browse/JDK-8241780), and we use JDK 15 to generate javadoc for that reason (4f9e308), so it should be safe to make changes like this one at this point.

@cushon
Copy link
Collaborator

cushon commented Feb 14, 2023

Javadoc has had a long-standing bug where a @ was interpreted as starting a tag if it was at the start of the line (after any initial *), even if the @ was inside a multiline {@code} or {@literal}. If we're able to determine that no version of Javadoc we use is affected by that bug anymore, we could potentially make simplifications like this one.

That was fixed in JDK 15 (https://bugs.openjdk.org/browse/JDK-8241780), and we use JDK 15 to generate javadoc for that reason (4f9e308), so it should be safe to make changes like this one at this point.

Er, looking at the failing CI, we still generating Javadoc for the entire matrix, and just using JDK 15 to publish it:

- name: 'Javadoc'
shell: bash
run: mvn -P '!examples' javadoc:aggregate

I don't mind letting it regress for JDK 11 at this point, but I'm not sure what the cleanest way to skip that in the matrix is.

@tbroyer
Copy link
Contributor

tbroyer commented Feb 17, 2023

I don't mind letting it regress for JDK 11 at this point, but I'm not sure what the cleanest way to skip that in the matrix is.

Maybe just add an if: to the step to only build (or skip) them on select JDK versions?
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsif

@cushon
Copy link
Collaborator

cushon commented Feb 21, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@pigelvy can you resolve this?

@pigelvy
Copy link
Contributor Author

pigelvy commented Feb 22, 2023

@cushon CLA signed. Sorry for the delay. It's my first time 😌

copybara-service bot pushed a commit that referenced this pull request Feb 22, 2023
In the javadoc, the character '@' can be used directly in `{@code …}`. Using `{@literal @}` causes wrong formatting of the Java code snippets.

Fixes #3779

RELNOTES=None.
FUTURE_COPYBARA_INTEGRATE_REVIEW=#3779 from pigelvy:patch-1 7436dfb
PiperOrigin-RevId: 511516303
@pigelvy pigelvy deleted the patch-1 branch February 22, 2023 21:54
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.

None yet

4 participants