Sonar Analyzes Java 23 + New Rules for Java 22

Dear Java Developers,

We’re happy to announce that SonarQube now offers support for Java versions up to Java 23, allowing early adopters to analyze their code with confidence, especially those planning to upgrade to the upcoming Java 25 LTS.

Building on this, we’ve introduced new rules specifically designed for Java 22 features and refined existing rules for better compatibility.

New Java 22 Rules:

  • S7466: Employ the "var" identifier for unnamed variable declarations.
  • S7467: Utilize the unnamed variable pattern for unused exception parameters.
  • S7475: Omit types of unused record components in pattern matching.

These rules are available today on SonarQube Cloud, and will be available in SonarQube Server 2025.3.

For those already working with Java 24 or exploring Java 25, we encourage you to share your feedback on which new Java features you’d like us to support in the future.

Jean

3 Likes

We’ve now added rules for Java 23 for best practise use of Markdown comments:

  • S7476: Comments should start with the appropriate number of slashes
  • S7474: Markdown, HTML and Javadoc tags should be consistent

Jean

2 Likes

Hello @jean.jimbo ! I’m on SonarQube for IDE: IntelliJ version 10.27.1.81796 and for this code:

    /// Infers the log level from the given message.
    ///
    /// @param message the message
    /// @return the inferred log level
    public static Level inferLevel(String message) {

I still get these java:S1176 issues:

  • Document the parameter(s): message
  • Document this method return value

Is this a bug or am I missing something? I already have sonar.java.source = 23 set. Thanks!

1 Like

Hi Giovanni,

Thank you for the report! It looks like we missed this when we updated the analyzer to support Markdown docs. I created a ticket to track this problem: SONARJAVA-5713.

Tomasz

1 Like