Sonar Analyzes Java 25 + New Rules

Dear Java Developers,

We’re happy to announce the availability of analysis for the latest Java 25 LTS. This release also comes with rules supporting your use of new Java 25 features:

JEP 506: Scoped Values

  • S8432 : “ScopedValue.where” results should not be ignored

JEP 513: Flexible Constructor Bodies

  • S8433: Validation logic should be placed in constructor prologue when possible
  • S8444: Excessive logic before super() should not bloat constructor

JEP 511: Module Import Declarations

  • S8445: Import declarations should be grouped by specificity

You can find these updates on:

SonarQube Cloud - now
SonarQube Server - from 2026.2
SonarQube Community Build - from 26.3.x
SonarQube IDE - your next plugin update

We welcome your feedback on these rules & would love to hear from you!

Jean

2 Likes

We’ve dropped another 3 rules to help you lean into writing (or generating) Java 25 code right.

JEP 513: Flexible Constructor Bodies

  • S8447: Subclass fields should be initialized before calls to “super()” or “this()”

JEP 512: Compact Source Files and Instance Main Methods

  • S8446: Only one “main” method should be defined in a class
  • S8450: Prefer “IO.readln()” over “BufferedReader” boilerplate

Availability for these is as follows:

SonarQube Cloud - now
SonarQube Server - from 2026.2
SonarQube Community Build - from 26.4.x
SonarQube IDE - your next plugin update

We received your feedback on rule S8445, and relaxed it to allow more styles of sorting imports. As always, we welcome more feedback on these rules.

Jean