diff --git a/sonar-java-plugin/src/main/java/org/sonar/plugins/java/JavaSonarWayProfile.java b/sonar-java-plugin/src/main/java/org/sonar/plugins/java/JavaSonarWayProfile.java index 94c9195a9bc..f29f4063ba6 100644 --- a/sonar-java-plugin/src/main/java/org/sonar/plugins/java/JavaSonarWayProfile.java +++ b/sonar-java-plugin/src/main/java/org/sonar/plugins/java/JavaSonarWayProfile.java @@ -56,6 +56,13 @@ public class JavaSonarWayProfile implements BuiltInQualityProfilesDefinition { private final ProfileRegistrar[] profileRegistrars; + /** + * Constructor used by Pico container (SC) when no ProfileRegistrar are available + */ + public JavaSonarWayProfile() { + this(null); + } + public JavaSonarWayProfile(@Nullable ProfileRegistrar[] profileRegistrars) { this.profileRegistrars = profileRegistrars; } diff --git a/sonar-java-plugin/src/test/java/org/sonar/plugins/java/JavaSonarWayProfileTest.java b/sonar-java-plugin/src/test/java/org/sonar/plugins/java/JavaSonarWayProfileTest.java index bdfd3370b32..a6d098fb4e6 100644 --- a/sonar-java-plugin/src/test/java/org/sonar/plugins/java/JavaSonarWayProfileTest.java +++ b/sonar-java-plugin/src/test/java/org/sonar/plugins/java/JavaSonarWayProfileTest.java @@ -85,7 +85,7 @@ void should_create_sonar_way_profile() { @Test void should_activate_hotspots_when_supported() { - JavaSonarWayProfile profileDef = new JavaSonarWayProfile(null); + JavaSonarWayProfile profileDef = new JavaSonarWayProfile(); BuiltInQualityProfilesDefinition.Context context = new BuiltInQualityProfilesDefinition.Context(); profileDef.define(context); BuiltInQualityProfilesDefinition.BuiltInQualityProfile profile = context.profile("java", "Sonar way");