[SQ 8.4.1] Unable to analyze Java 14 code

SonarQube server 8.4.1 running in a Docker container
Our code is on Java 11 which we are migrating to Java 14

We are having an issue scanning code that uses java.util.Objects.nonNull

Unable to run check class org.sonar.java.se.SymbolicExecutionVisitor -  on file 'src/main/java/com.mycompany/MyClass.java', To help improve the SonarSource Java Analyzer, please report this problem to SonarSource: see https://community.sonarsource.com/
org.sonar.java.bytecode.se.BytecodeEGWalker$BytecodeAnalysisException: Failed dataflow analysis for java.util.Objects#nonNull(Ljava/lang/Object;)Z
	at org.sonar.java.bytecode.se.BytecodeEGWalker.getMethodBehavior(BytecodeEGWalker.java:299)
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 58
	at org.objectweb.asm.ClassReader.<init>(ClassReader.java:195)

Steps to Reproduce:
Run sonarqube-gradle-plugin on following code

import static java.util.Objects.nonNull;

public class MyClass {
    public boolean nonNullFunction(String input) {
        return nonNull(input);

This works ok on Java 11 but running SonarQube on Java 14 gets the above error.

Current Workaround:
replace nonNull(input) with input != null


As announced in the following thread, support of Java 14 is not yet available for SonarQube, but only for SonarCloud. The support of Java 14 will be shipped with SonarQube 8.5.


Hi Michael
Thanks for the update.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.