Sonar-scanner failing on pattern matching with final attribute

With JDK 16 pattern matching was introduced (JEP 394: Pattern Matching for instanceof)

if (someObject instanceof final Foo foo) {
fails with

[ERROR] Unable to parse source file : '.../SomeClass.java'
[ERROR] Parse error at line xxx column xx: Syntax error on token "final", delete this token

whereas
if (someObject instanceof Foo foo) {
works.

Anyone can confirm this?

Community Edition Version 8.9.8 (build 54436)

Hey there.

As asked in the topic template, what version of SonarQube are you using?

Updated my question

Thanks.

Support for Java 16 was introduced in SonarQube v9.0 – the current supported v9.x of SonarQube is SonarQube v9.5 (which also supports parsing Java 17 and 18!)

Thanks for the quick reply. Mystery solved!