Fix CheckReturnValue and remove indirect Doubles dependency in Mermaid

When building Gitiles with strict ErrorProne checks during Google3
import (CL 972611210), compilation failed due to:

1. In SimpleMermaidRenderer.CharScanner: next(), consume(String), and
   consumeIgnoreCase(String) return values were ignored when advancing
   tokens or skipping delimiters, triggering 64 CheckReturnValue compiler
   errors. Refactor CharScanner to provide void advance(), void skip(String),
   and void skipIgnoreCase(String) for token skipping, and boolean
   tryConsume(String) / tryConsumeIgnoreCase(String) for the few sites
   where the return value is tested. This eliminates unused return values
   and avoids unnecessary CanIgnoreReturnValue annotations.
2. In SimpleMermaidRendererTest:
   - render(code5) return value was unused; assert that the returned
     SvgDoc is not null.
   - Doubles.tryParse(part) pulled in com.google.common.primitives.Doubles
     as an indirect dependency; replace with inline Double.parseDouble(part)
     in a try/catch block.

Change-Id: I32de733a3bae5ba75a50d9f74af4c21084940f79
2 files changed
tree: 673d37bd81f961c5ef62b7e961cc87fe29e1008d
  1. .settings/
  2. Documentation/
  3. java/
  4. javatests/
  5. lib/
  6. modules/
  7. resources/
  8. tools/
  9. .bazelignore
  10. .bazelrc
  11. .bazelversion
  12. .gitignore
  13. .gitmodules
  14. .mailmap
  15. .zuul.yaml
  16. BUILD
  17. COPYING
  18. external_deps.lock.json
  19. fake_pom_deploy.xml
  20. MODULE.bazel
  21. MODULE.bazel.lock
  22. navbar.md
  23. README.md
  24. version.bzl
README.md

Gitiles - A simple JGit repository browser

Gitiles is a simple repository browser for Git repositories, built on JGit. Its guiding principle is simplicity: it has no formal access controls, no write access, no fancy Javascript, etc.

Gitiles automatically renders *.md Markdown files into HTML for simplified documentation. Refer to the Markdown documentation for details.

Configuration

Gitiles is configurable in a git-style configuration file named gitiles.config. Refer to the configuration documentation for details.

Bugs

Use gerrit's issue tracker to file bugs.

Contributing to Gitiles

Please refer to the Developer Guide.