Sonarqube Gradle plugin - CollectorsToListCheck: java.lang.IndexOutOfBoundsException: Index: 0

Running the sonar Gradle task produces the following:

Unable to run check class - S6204 on file 'support/cas-server-support-saml-idp-core/src/main/java/org/apereo/cas/support/saml/services/idp/metadata/', To help improve the SonarSource Java Analyzer, please report this problem to SonarSource: see
java.lang.IndexOutOfBoundsException: Index: 0
	at java.base/java.util.Collections$EmptyList.get(
  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)

Sonarqube Gradle plugin: with JDK 21


Gradle 8.7

Build time:   2024-03-22 15:52:46 UTC
Revision:     650af14d7653aa949fce5e886e685efc9cf97c10

Kotlin:       1.9.22
Groovy:       3.0.17
Ant:          Apache Ant(TM) version 1.10.13 compiled on January 4 2023
JVM:          21 (Oracle Corporation 21+35-2513)
OS:           Mac OS X 14.4.1 aarch64

Gradle task:

./gradlew sonar --build-cache --configure-on-demand --no-daemon -DskipAot=true --parallel \
    -x javadoc -Dsonar.login="${SONARCLOUD_TOKEN}" -DskipNestedConfigMetadataGen=true -Dverbose=true \

Hey ther.e

Just to confirm – you’re actually connecting to SonarCloud, not a self-hosted SonarQube instance?

Can you provide a copy of support/cas-server-support-saml-idp-core/src/main/java/org/apereo/cas/support/saml/services/idp/metadata/

Correct. This is SonarCloud.

Here is the file:

Hello @mmoayyed

Thanks for the report. As the project is open source, I was able to reproduce the issue relatively easily and can confirm that there is an issue with how the lombok val feature is (not) supported by rule S6204.

I’ve created a ticket, where you can follow the progress of this issue.

1 Like

Thank you. It appears that my account may not have enough permissions to watch the JIRA, and I’ll check back periodically.

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