Error Prone is never detected in Maven builds: the regex in jvm/analysis.py contains literal backspace bytes where \b was meant

Open Beginner friendly
#251 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
Under an hour
Newbie friendliness
84/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java, python
Domain
tooling

Research direction

The bad pattern is on line 183 of project_validator/ecosystems/jvm/analysis.py, in the _ERROR_PRONE regex, where literal 0x08 bytes stand in for \b. Run grep -P '\x08' -r project_validator to confirm that this file is the only one affected, then check the regex against the pom.xml snippets quoted in the issue. Done means error_prone_core and -Xplugin:ErrorProne match, and the guava static-analysis check reports Error Prone as detected.

Written by the indexing model from the issue text.

Description

project_validator/ecosystems/jvm/analysis.py:183 holds \x08 characters (a Python string "\b…" written without the raw prefix) where word boundaries were intended, so error_prone_core and -Xplugin:ErrorProne can never match: guava's static-analysis FAILs "no static analyzer runs" despite pom.xml:220 (and --answers shows Error Prone "defined": {}).

Evidence from the corpus audit

google/guava / static-analysis (Error Prone never detected in Maven builds)
  • kind: FALSE_NEGATIVE
  • actual: FAIL: JVM: no static analyzer runs (--answers: Error Prone "defined": {})
  • expected: PASS/WARN naming Error Prone: it is on the compiler's processor path and -Xplugin:ErrorProne is passed on every compile that mvn verify runs (guava only enables one check, Java8ApiChecker, which deserves a mention, not a miss)
  • evidence:
    • guava pom.xml:220: <arg>-Xplugin:ErrorProne -Xep:Java8ApiChecker:ERROR -XepDisableAllWarnings</arg>; pom.xml:238-240: <groupId>com.google.errorprone</groupId> / <artifactId>error_prone_core</artifactId>
    • validator project_validator/ecosystems/jvm/analysis.py:183 contains literal 0x08 bytes: sed -n 183p ... | cat -A →
      _ERROR_PRONE = re.compile(rf"^Herror_prone_core^H|-Xplugin:ErrorProne^H|{_ERROR_PRONE_GRADLE}");
      _ERROR_PRONE.pattern = '\x08error_prone_core\x08|-Xplugin:ErrorProne\x08|...';
      _ERROR_PRONE.search("<artifactId>error_prone_core</artifactId>") → False, _ERROR_PRONE.search("<arg>-Xplugin:ErrorProne -Xep</arg>") → False.
      Only the third alternative (Gradle id("net.ltgt.errorprone")) can match, which is why mockito and junit5 pass.
      grep -rlP '\x08' --include=*.py project_validator finds only this file.
  • repro: pom.xml whose maven-compiler-plugin has <annotationProcessorPaths><path><artifactId>error_prone_core</artifactId>... and <arg>-Xplugin:ErrorProne</arg>, workflow run: mvn verify
  • confidence: high

Found by the regression-corpus audit (235 real repositories, one or more per ecosystem profile; corpus and expected results in corpus/). Evidence is quoted from the audited checkouts at the commits pinned in corpus/projects.toml; <checkouts>/<owner>__<repo> is such a checkout.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt

Dominant language
Python
Stars
4
Forks
1
Avg merge
10h 41m
Merged PRs (30d)
79

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cpp-best-practices/project_validator

All issues in cpp-best-practices/project_validator

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.