/sonar-java-s4248-npe

Test case for a SonarQube bug involving SonarJava 5.9+

Primary LanguageDockerfileGNU Lesser General Public License v3.0LGPL-3.0

Reproducer for a SonarQube bug involving SonarJava 5.9.1

Prerequisites

  • Docker
  • JDK 8

Set up

Build the Docker image of SonarQube with a few plugins:

docker build -t sonarqube:s4248-npe .

Run a SonarQube container:

docker run --rm -p 9000:9000 --name sonarqube sonarqube:s4248-npe

Once SonarQube is up:

  1. Open http://localhost:9000/sessions/new?return_to=%2Fprofiles
  2. Log in as admin / admin
  3. Skip the tutorial
  4. Create a new "Test" quality profile, then set it as the default quality profile
  5. Go to http://localhost:9000/coding_rules?open=squid%3AS4248&q=S4248 and activate the S4248 rule on the quality profile

Run the analysis on the project

./gradlew sonarqube --stacktrace

Stop the SonarQube container

docker stop sonarqube

Licensed under the LGPL 3.