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

InvalidInlinteTag: @snippet javadoc false positive #4308

Closed
xenoterracide opened this issue Mar 4, 2024 · 0 comments
Closed

InvalidInlinteTag: @snippet javadoc false positive #4308

xenoterracide opened this issue Mar 4, 2024 · 0 comments

Comments

@xenoterracide
Copy link

xenoterracide commented Mar 4, 2024

warning: [InvalidInlineTag] The tag @snippet is not allowed on this type of element.
   * Converts a checked exception to a {@link RuntimeException} exception.
     ^
    (see https://errorprone.info/bugpattern/InvalidInlineTag)
  Did you mean '*'?

https://openjdk.org/jeps/413

  /**
   * Converts a checked exception to a {@link RuntimeException}.
   * {@snippet :
   * try {
   *   throw new IOException();
   * } catch (Exception e) {
   *   throw ExceptionTools.toRuntime(e);
   * }
   * // Try is from vavr.io
   * Try.of(() -> { throw new IOException(); })
   *    .getOrElseThrow(ExceptionTools::toRuntime);
   *}
   *
   * @param e the exception to convert. {@link NonNull}
   * @return {@link RuntimeException} the converted exception {@link NonNull}
   * @implNote
   * <ul>
   *   <li>{@link IOException} to {@link UncheckedIOException}.</li>
   *   <li>{@link RuntimeException} is returned as is.</li>
   *   <li>Other exceptions are wrapped in a {@link RuntimeException}.</li>
   * </ul>
   * @see <a href="https://docs.vavr.io/#_try">vavr.io Try</a>
   */
  // CHECKSTYLE:OFF: ReturnCount - library to avoid conditional returns and throws elsewhere
  public static @NonNull RuntimeException toRuntime(@NonNull Throwable e) {

EP 2.25.0
Gradle Plugin 3.1.0
Javadoc should use the version with 21, but release is set to 11

java {
  withJavadocJar()
  withSourcesJar()
  toolchain {
    languageVersion.set(JavaLanguageVersion.of(21))
  }
}

tasks.compileJava {
  options.release = 11
}

Also, InvalidInlinteTag could really use more documentation (meaning any at all)

copybara-service bot pushed a commit that referenced this issue Apr 4, 2024
Fixes external #4308.

PiperOrigin-RevId: 621493487
copybara-service bot pushed a commit that referenced this issue Apr 4, 2024
Fixes external #4308.

PiperOrigin-RevId: 621845649
@cushon cushon closed this as completed Apr 26, 2024
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

No branches or pull requests

2 participants