SonarLint Java S2583 False positive: Java 16 pattern matching


I’m running SonarLint on IntelliJ (plugin version:, IntelliJ version 2021.2 Ultimate Edition)

Here an example of the issue:

if (o instanceof byte[] arrayByte) {
} else if (o instanceof char[] arrayChar) {

The error is reported on second condition if (o instanceof char[] arrayChar) because it is considered as always false.

1 Like

Hello @Lehtto, and welcome to the community!

Indeed, this is a false positive, thanks for taking the time to report it. Ticket created: SONARJAVA-3986.

Have a nice day.

1 Like

Hi @Quentin
Thank you for your support and your time.

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