Skip to content

Commit

Permalink
Fix '@' character in javadoc code snippets
Browse files Browse the repository at this point in the history
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
  • Loading branch information
cushon authored and Error Prone Team committed Feb 22, 2023
1 parent 7976d8f commit 12b6a20
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
* example through code review, could be marked {@code @ReviewedFooBar}.
*
* <pre>{@code
* public {@literal @}interface LegacyUnsafeFooBar{}
* public @interface LegacyUnsafeFooBar{}
*
* public {@literal @}interface ReviewedFooBar{
* public @interface ReviewedFooBar{
* public string reviewer();
* public string comments();
* }
*
* public class Foo {
* {@literal @}RestrictedApi(
* @RestrictedApi(
* explanation="You could shoot yourself in the foot with Foo.bar if you aren't careful",
* link="http://edsger.dijkstra/foo_bar_consider_harmful.html",
* allowedOnPath="testsuite/.*", // Unsafe behavior in tests is ok.
Expand All @@ -61,7 +61,7 @@
* }
* boolean complicatedCondition = true;
*
* {@literal @}ReviewedFooBar(
* @ReviewedFooBar(
* reviewer="bangert",
* comments="Makes sure complicatedCondition isn't true, so bar is safe!"
* )
Expand All @@ -71,7 +71,7 @@
* }
* }
*
* {@literal @}LegacyUnsafeFooBar
* @LegacyUnsafeFooBar
* public void someOldCode() {
* // ...
* bar()
Expand Down

0 comments on commit 12b6a20

Please sign in to comment.