Skip to content

Fixes #2: Add Error Prone, NullAway and JSpecify - #3

Merged
manoelcampos merged 1 commit into
masterfrom
add-errorprone-nullaway
Oct 19, 2026
Merged

manoelcampos merged 1 commit into
masterfrom
add-errorprone-nullaway

Conversation

@manoelcampos

Copy link
Copy Markdown
Contributor

Closes #2

Changes

  • Build: maven-compiler-plugin runs Error Prone 2.50.0 with NullAway 0.14.2 at ERROR level. .mvn/jvm.config adds the JDK options Error Prone needs. StringConcatToTextBlock is disabled because it crashes on some code.
  • JSpecify: every package has a package-info.java with @NullMarked, and NullAway runs with OnlyNullMarked=true. This way only this project's code is checked; CloudSim Plus classes (some share package names, such as org.cloudsimplus.testbeds and org.cloudsimplus.heuristics) are seen as unannotated.
  • CI: builds on JDK 21, since Error Prone 2.50 requires it. <release>17</release> is kept, so the generated bytecode doesn't change.
  • Null-safety fixes: default values, @Nullable where null is valid, and @SuppressWarnings("NullAway.Init") for fields set after construction (with a comment saying where).

Bugs and other changes from the tools

Where Change
CloudletToVmMappingSolutionBenchmark.doSetup() A local variable shadowed the heuristic field, so the field stayed null and was passed to CloudletToVmMappingSolution.

Tests

mvn -B package passes locally on JDK 21 and 25.

Related: cloudsimplus/cloudsimplus#570

🤖 Generated with Claude Code

- Run Error Prone and NullAway (as an Error Prone check) on compilation.
- Mark all packages as JSpecify @NullMarked, so NullAway checks just the
  project code (dependencies are seen as unannotated).
- Fix the issues the tools found.
- Build on JDK 21 in CI, since Error Prone requires it (bytecode still targets Java 17).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@manoelcampos manoelcampos added the enhancement New feature or request label Oct 19, 2026
@manoelcampos manoelcampos self-assigned this Oct 19, 2026
@manoelcampos
manoelcampos merged commit 60e7d8b into master Oct 19, 2026
1 check passed
@manoelcampos
manoelcampos deleted the add-errorprone-nullaway branch October 19, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Error Prone, NullAway and JSpecify

1 participant