From 182d35fb2af805acdf6685f2846fe29d4723eac6 Mon Sep 17 00:00:00 2001 From: rombirli Date: Wed, 14 Oct 2026 15:40:10 +0200 Subject: [PATCH 1/4] Add rule metadata --- .../org/sonar/l10n/java/rules/java/S9439.html | 66 +++++++++++++++++++ .../org/sonar/l10n/java/rules/java/S9439.json | 23 +++++++ .../main/resources/profiles/Sonar_way/S9439 | 0 3 files changed, 89 insertions(+) create mode 100644 sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S9439.html create mode 100644 sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S9439.json create mode 100644 sonar-java-plugin/src/main/resources/profiles/Sonar_way/S9439 diff --git a/sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S9439.html b/sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S9439.html new file mode 100644 index 00000000000..eaef643db21 --- /dev/null +++ b/sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S9439.html @@ -0,0 +1,66 @@ +

Why is this an issue?

+

This rule raises an issue when a local variable declaration or a field declaration uses an array initializer preceded by an explicit array creation +expression whose type is the same as the declared type.

+

When an array variable or field is declared and initialized in the same statement, Java allows the array initializer to stand on its own: +int[] delays = {100, 500, 2000};. Writing an explicit array creation expression in front of it, as in int[] delays = new int[] +{100, 500, 2000};, repeats the element type and the array-ness that the declaration on the left already states.

+

The line then carries the same type information twice and pushes the values, the only part that actually differs between two such declarations, +further to the right. In a class holding several constant arrays, this repetition makes the declarations harder to scan and to compare.

+

Both forms compile to the same bytecode, so dropping the redundant new <type>[] prefix changes nothing at runtime.

+

To fix it, delete the new <type>[] prefix and keep the curly-brace initializer alone.

+

Exceptions

+

The shorthand initializer is only legal in a declaration. Everywhere else the explicit array creation expression is mandatory, so no issue is +raised on:

+ +

Annotation element values are not concerned: they already require the shorthand, because an array creation expression is not a constant expression +and the compiler rejects it there.

+

No issue is raised either when the created type differs from the declared type, because dropping the prefix would change the runtime type of the +array:

+
+Object[] values = new String[] {"GET", "HEAD"};
+
+

Declarations using var are not reported, since var values = {1, 2}; does not compile: an array initializer carries no +type of its own and var needs one.

+

A created type carrying a type annotation is not reported either, as in String[] names = new @Marker String[] {"GET"};. The shorthand +form has nowhere to put the annotation, so dropping the prefix would silently discard it.

+

How to fix it

+

Remove the new <type>[] part that sits between the = sign and the opening brace, and leave the initializer as is. +The number and the order of the elements stay untouched, and the declared type on the left keeps driving the type of the created array, so the fix +preserves behavior.

+

Code examples

+

Noncompliant code example

+
+public class HttpDefaults {
+
+  private static final String[] SAFE_METHODS = new String[] {"GET", "HEAD", "OPTIONS"}; // Noncompliant
+
+  public int retryDelay(int attempt) {
+    int[] delays = new int[] {100, 500, 2000}; // Noncompliant
+    return delays[Math.min(attempt, delays.length - 1)];
+  }
+}
+
+

Compliant solution

+
+public class HttpDefaults {
+
+  private static final String[] SAFE_METHODS = {"GET", "HEAD", "OPTIONS"};
+
+  public int retryDelay(int attempt) {
+    int[] delays = {100, 500, 2000};
+    return delays[Math.min(attempt, delays.length - 1)];
+  }
+}
+
+

Resources

+

Documentation

+ + diff --git a/sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S9439.json b/sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S9439.json new file mode 100644 index 00000000000..7abd7221684 --- /dev/null +++ b/sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S9439.json @@ -0,0 +1,23 @@ +{ + "title": "Array initializers should use the shorthand form instead of an explicit \"new\" array creation", + "type": "CODE_SMELL", + "status": "ready", + "remediation": { + "func": "Constant\/Issue", + "constantCost": "2min" + }, + "tags": [ + "convention" + ], + "defaultSeverity": "Minor", + "ruleSpecification": "RSPEC-9439", + "sqKey": "S9439", + "scope": "All", + "quickfix": "targeted", + "code": { + "impacts": { + "MAINTAINABILITY": "LOW" + }, + "attribute": "CLEAR" + } +} diff --git a/sonar-java-plugin/src/main/resources/profiles/Sonar_way/S9439 b/sonar-java-plugin/src/main/resources/profiles/Sonar_way/S9439 new file mode 100644 index 00000000000..e69de29bb2d From b2d9ad3be2d71751cdc69fda13d915d1e8c750d0 Mon Sep 17 00:00:00 2001 From: rombirli Date: Wed, 14 Oct 2026 15:43:44 +0200 Subject: [PATCH 2/4] Add failing reproducer --- .../ShortArrayInitializerCheckSample.java | 110 ++++++++++++++++++ .../checks/ShortArrayInitializerCheck.java | 35 ++++++ .../ShortArrayInitializerCheckTest.java | 45 +++++++ 3 files changed, 190 insertions(+) create mode 100644 java-checks-test-sources/default/src/main/java/checks/ShortArrayInitializerCheckSample.java create mode 100644 java-checks/src/main/java/org/sonar/java/checks/ShortArrayInitializerCheck.java create mode 100644 java-checks/src/test/java/org/sonar/java/checks/ShortArrayInitializerCheckTest.java diff --git a/java-checks-test-sources/default/src/main/java/checks/ShortArrayInitializerCheckSample.java b/java-checks-test-sources/default/src/main/java/checks/ShortArrayInitializerCheckSample.java new file mode 100644 index 00000000000..96943c3a063 --- /dev/null +++ b/java-checks-test-sources/default/src/main/java/checks/ShortArrayInitializerCheckSample.java @@ -0,0 +1,110 @@ +package checks; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.List; + +public class ShortArrayInitializerCheckSample { + + private static final String[] SAFE_METHODS = new String[] {"GET", "HEAD", "OPTIONS"}; // Noncompliant {{Remove the "new String[]" prefix; the declaration already specifies the array type.}} [[quickfixes=qf1]] + // ^^^^^^^^^^^^ + // fix@qf1 {{Remove the redundant array creation}} + // edit@qf1 [[sc=48;ec=61]] {{}} + + private static final int[] EMPTY = new int[] {}; // Noncompliant + // ^^^^^^^^^ + + private final char[] separators = new char[] {',', ';'}; // Noncompliant + // ^^^^^^^^^^ + + private static final int[][] GRID = new int[][] {{1, 2}, {3, 4}}; // Noncompliant {{Remove the "new int[][]" prefix; the declaration already specifies the array type.}} [[quickfixes=qf2]] + // ^^^^^^^^^^^ + // fix@qf2 {{Remove the redundant array creation}} + // edit@qf2 [[sc=39;ec=51]] {{}} + + private static final List[] RAW_LISTS = new List[] {}; // Noncompliant + // ^^^^^^^^^^ + + private static final String[] NO_INITIALIZER = new String[3]; + + private static final String[] SHORTHAND = {"GET", "HEAD"}; + + int[] retryDelaysMillis() { + int[] delays = new int[] {100, 500, 2_000}; // Noncompliant [[quickfixes=qf3]] + // ^^^^^^^^^ + // fix@qf3 {{Remove the redundant array creation}} + // edit@qf3 [[sc=20;ec=30]] {{}} + return delays; + } + + void multipleDeclarators() { + int[] first = new int[] {1}, // Noncompliant + // ^^^^^^^^^ + second = new int[] {2}; // Noncompliant + // ^^^^^^^^^ + } + + void alreadyShorthand() { + int[] delays = {100, 500}; + String[] methods = {"GET"}; + } + + void sizedCreation() { + int[] delays = new int[3]; + int[][] grid = new int[2][2]; + int[][] partial = new int[2][]; + } + + void assignmentToExistingVariable() { + int[] delays; + delays = new int[] {1, 2}; + delays = new int[0]; + } + + void methodArgument() { + accepts(new String[] {"GET"}); + acceptsVarargs(new String[] {"GET"}); + } + + String[] returnStatement() { + return new String[] {"GET"}; + } + + void inferredType() { + var methods = new String[] {"GET"}; + var grid = new int[][] {{1}}; + } + + void widerDeclaredType() { + Object[] values = new String[] {"a"}; + Object single = new String[] {"a"}; + } + + void nestedExplicitCreation() { + int[][] grid = {new int[] {1, 2}, new int[] {3}}; + } + + void annotatedCreatedType() { + String[] names = new @Marker String[] {"GET"}; + String[] dimensions = new String @Marker [] {"GET"}; + int[][] grid = new int[] @Marker [] {{1}}; + } + + @Methods(value = {"GET", "HEAD"}) + void annotationShorthand() { + } + + void accepts(String[] methods) { + } + + void acceptsVarargs(String... methods) { + } + + @interface Methods { + String[] value(); + } + + @Target(ElementType.TYPE_USE) + @interface Marker { + } +} diff --git a/java-checks/src/main/java/org/sonar/java/checks/ShortArrayInitializerCheck.java b/java-checks/src/main/java/org/sonar/java/checks/ShortArrayInitializerCheck.java new file mode 100644 index 00000000000..d192fad4d3c --- /dev/null +++ b/java-checks/src/main/java/org/sonar/java/checks/ShortArrayInitializerCheck.java @@ -0,0 +1,35 @@ +/* + * SonarQube Java + * Copyright (C) SonarSource Sàrl + * mailto:info AT sonarsource DOT com + * + * You can redistribute and/or modify this program under the terms of + * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.java.checks; + +import java.util.List; +import org.sonar.check.Rule; +import org.sonar.plugins.java.api.IssuableSubscriptionVisitor; +import org.sonar.plugins.java.api.tree.Tree; + +@Rule(key = "S9439") +public class ShortArrayInitializerCheck extends IssuableSubscriptionVisitor { + + @Override + public List nodesToVisit() { + return List.of(Tree.Kind.VARIABLE); + } + + @Override + public void visitNode(Tree tree) { + } +} diff --git a/java-checks/src/test/java/org/sonar/java/checks/ShortArrayInitializerCheckTest.java b/java-checks/src/test/java/org/sonar/java/checks/ShortArrayInitializerCheckTest.java new file mode 100644 index 00000000000..326265ac8ed --- /dev/null +++ b/java-checks/src/test/java/org/sonar/java/checks/ShortArrayInitializerCheckTest.java @@ -0,0 +1,45 @@ +/* + * SonarQube Java + * Copyright (C) SonarSource Sàrl + * mailto:info AT sonarsource DOT com + * + * You can redistribute and/or modify this program under the terms of + * the Sonar Source-Available License Version 1, as published by SonarSource Sàrl. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Sonar Source-Available License for more details. + * + * You should have received a copy of the Sonar Source-Available License + * along with this program; if not, see https://sonarsource.com/license/ssal/ + */ +package org.sonar.java.checks; + +import org.junit.jupiter.api.Test; +import org.sonar.java.checks.verifier.CheckVerifier; + +import static org.sonar.java.checks.verifier.TestUtils.mainCodeSourcesPath; + +class ShortArrayInitializerCheckTest { + + private static final String SAMPLE = "checks/ShortArrayInitializerCheckSample.java"; + private static final ShortArrayInitializerCheck CHECK = new ShortArrayInitializerCheck(); + + @Test + void test() { + CheckVerifier.newVerifier() + .onFile(mainCodeSourcesPath(SAMPLE)) + .withCheck(CHECK) + .verifyIssues(); + } + + @Test + void test_without_semantic() { + CheckVerifier.newVerifier() + .onFile(mainCodeSourcesPath(SAMPLE)) + .withCheck(CHECK) + .withoutSemantic() + .verifyIssues(); + } +} From 89462bc83b320e6b6efcb9684d12fa0d16cd17d7 Mon Sep 17 00:00:00 2001 From: rombirli Date: Wed, 14 Oct 2026 15:48:11 +0200 Subject: [PATCH 3/4] Implement rule --- .../checks/ShortArrayInitializerCheck.java | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/java-checks/src/main/java/org/sonar/java/checks/ShortArrayInitializerCheck.java b/java-checks/src/main/java/org/sonar/java/checks/ShortArrayInitializerCheck.java index d192fad4d3c..76208ab9023 100644 --- a/java-checks/src/main/java/org/sonar/java/checks/ShortArrayInitializerCheck.java +++ b/java-checks/src/main/java/org/sonar/java/checks/ShortArrayInitializerCheck.java @@ -17,13 +17,29 @@ package org.sonar.java.checks; import java.util.List; +import java.util.regex.Pattern; import org.sonar.check.Rule; +import org.sonar.java.checks.helpers.QuickFixHelper; +import org.sonar.java.reporting.JavaQuickFix; +import org.sonar.java.reporting.JavaTextEdit; import org.sonar.plugins.java.api.IssuableSubscriptionVisitor; +import org.sonar.plugins.java.api.semantic.Type; +import org.sonar.plugins.java.api.tree.ArrayDimensionTree; +import org.sonar.plugins.java.api.tree.ExpressionTree; +import org.sonar.plugins.java.api.tree.NewArrayTree; +import org.sonar.plugins.java.api.tree.SyntaxToken; import org.sonar.plugins.java.api.tree.Tree; +import org.sonar.plugins.java.api.tree.TypeTree; +import org.sonar.plugins.java.api.tree.VarTypeTree; +import org.sonar.plugins.java.api.tree.VariableTree; @Rule(key = "S9439") public class ShortArrayInitializerCheck extends IssuableSubscriptionVisitor { + private static final String MESSAGE = "Remove the \"%s\" prefix; the declaration already specifies the array type."; + private static final String QUICK_FIX_MESSAGE = "Remove the redundant array creation"; + private static final Pattern WHITESPACE = Pattern.compile("\\s+"); + @Override public List nodesToVisit() { return List.of(Tree.Kind.VARIABLE); @@ -31,5 +47,50 @@ public List nodesToVisit() { @Override public void visitNode(Tree tree) { + VariableTree variable = (VariableTree) tree; + if (variable.type() instanceof VarTypeTree) { + return; + } + ExpressionTree initializer = variable.initializer(); + if (initializer == null || !initializer.is(Tree.Kind.NEW_ARRAY)) { + return; + } + NewArrayTree newArray = (NewArrayTree) initializer; + SyntaxToken newKeyword = newArray.newKeyword(); + SyntaxToken openBrace = newArray.openBraceToken(); + if (newKeyword == null || openBrace == null || isAnnotated(newArray) || !isSameType(variable, newArray)) { + return; + } + SyntaxToken lastBracket = lastCloseBracketToken(newArray); + String prefix = WHITESPACE.matcher(QuickFixHelper.contentForRange(newKeyword, lastBracket, context)).replaceAll(" "); + QuickFixHelper.newIssue(context) + .forRule(this) + .onRange(newKeyword, lastBracket) + .withMessage(MESSAGE, prefix) + .withQuickFix(() -> JavaQuickFix.newQuickFix(QUICK_FIX_MESSAGE) + .addTextEdit(JavaTextEdit.replaceBetweenTree(newKeyword, true, openBrace, false, "")) + .build()) + .report(); + } + + /** + * The shorthand initializer has nowhere to carry a type annotation, so removing the array creation + * would silently discard annotations such as the one in {@code new @Marker String[] {"a"}}. + */ + private static boolean isAnnotated(NewArrayTree newArray) { + TypeTree type = newArray.type(); + return (type != null && !type.annotations().isEmpty()) + || newArray.dimensions().stream().anyMatch(dimension -> !dimension.annotations().isEmpty()); + } + + private static boolean isSameType(VariableTree variable, NewArrayTree newArray) { + Type declaredType = variable.symbol().type(); + Type createdType = newArray.symbolType(); + return !declaredType.isUnknown() && !createdType.isUnknown() && declaredType.equals(createdType); + } + + private static SyntaxToken lastCloseBracketToken(NewArrayTree newArray) { + List dimensions = newArray.dimensions(); + return dimensions.get(dimensions.size() - 1).closeBracketToken(); } } From 2a1a0c8854aec5ca786fe960e004e6f60b78731d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 14 Oct 2026 14:28:32 +0000 Subject: [PATCH 4/4] Update ruling expectations --- .../commons-beanutils/java-S9439.json | 104 +++++++++++++++++ .../java-S9439.json | 33 ++++++ .../expected/eclipse-jetty/java-S9439.json | 106 ++++++++++++++++++ .../expected/sonarqube-6.5/java-S9439.json | 57 ++++++++++ 4 files changed, 300 insertions(+) create mode 100644 its/ruling/src/test/resources/expected/commons-beanutils/java-S9439.json create mode 100644 its/ruling/src/test/resources/expected/eclipse-jetty-similar-to-main/java-S9439.json create mode 100644 its/ruling/src/test/resources/expected/eclipse-jetty/java-S9439.json create mode 100644 its/ruling/src/test/resources/expected/sonarqube-6.5/java-S9439.json diff --git a/its/ruling/src/test/resources/expected/commons-beanutils/java-S9439.json b/its/ruling/src/test/resources/expected/commons-beanutils/java-S9439.json new file mode 100644 index 00000000000..100125b8532 --- /dev/null +++ b/its/ruling/src/test/resources/expected/commons-beanutils/java-S9439.json @@ -0,0 +1,104 @@ +{ +"commons-beanutils:src/main/java/org/apache/commons/beanutils2/BeanUtilsBean.java": [ +1108 +], +"commons-beanutils:src/main/java/org/apache/commons/beanutils2/converters/ArrayConverter.java": [ +135 +], +"commons-beanutils:src/test/java/org/apache/commons/beanutils2/BeanMapTestCase.java": [ +181, +208, +226 +], +"commons-beanutils:src/test/java/org/apache/commons/beanutils2/BeanUtilsTestCase.java": [ +679, +681 +], +"commons-beanutils:src/test/java/org/apache/commons/beanutils2/ConvertUtilsTestCase.java": [ +305, +306, +494, +496 +], +"commons-beanutils:src/test/java/org/apache/commons/beanutils2/DynaBeanMapDecoratorTestCase.java": [ +44, +53 +], +"commons-beanutils:src/test/java/org/apache/commons/beanutils2/DynaBeanUtilsTestCase.java": [ +530, +532 +], +"commons-beanutils:src/test/java/org/apache/commons/beanutils2/LazyDynaListTestCase.java": [ +42 +], +"commons-beanutils:src/test/java/org/apache/commons/beanutils2/PropertyUtilsTestCase.java": [ +212, +1030, +1031, +1051, +1052, +1167, +2603, +2604, +2620, +2621, +3082 +], +"commons-beanutils:src/test/java/org/apache/commons/beanutils2/TestBean.java": [ +514 +], +"commons-beanutils:src/test/java/org/apache/commons/beanutils2/bugs/Jira345TestCase.java": [ +98, +100 +], +"commons-beanutils:src/test/java/org/apache/commons/beanutils2/bugs/Jira381TestCase.java": [ +52 +], +"commons-beanutils:src/test/java/org/apache/commons/beanutils2/bugs/Jira465TestCase.java": [ +83, +95 +], +"commons-beanutils:src/test/java/org/apache/commons/beanutils2/bugs/other/Jira18BeanFactory.java": [ +43 +], +"commons-beanutils:src/test/java/org/apache/commons/beanutils2/bugs/other/Jira61BeanFactory.java": [ +44 +], +"commons-beanutils:src/test/java/org/apache/commons/beanutils2/converters/ArrayConverterTestCase.java": [ +76, +79, +80, +81, +82, +217, +225, +226, +271 +], +"commons-beanutils:src/test/java/org/apache/commons/beanutils2/converters/BooleanConverterTestCase.java": [ +28, +32 +], +"commons-beanutils:src/test/java/org/apache/commons/beanutils2/converters/DateConverterTestBase.java": [ +316 +], +"commons-beanutils:src/test/java/org/apache/commons/beanutils2/expression/DefaultResolverTestCase.java": [ +31, +32, +35, +36, +37, +40, +41, +42, +44, +45, +46 +], +"commons-beanutils:src/test/java/org/apache/commons/beanutils2/locale/LocaleConvertUtilsTestCase.java": [ +352, +353, +548, +550 +] +} diff --git a/its/ruling/src/test/resources/expected/eclipse-jetty-similar-to-main/java-S9439.json b/its/ruling/src/test/resources/expected/eclipse-jetty-similar-to-main/java-S9439.json new file mode 100644 index 00000000000..3bd85aa9a35 --- /dev/null +++ b/its/ruling/src/test/resources/expected/eclipse-jetty-similar-to-main/java-S9439.json @@ -0,0 +1,33 @@ +{ +"eclipse-jetty:jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java": [ +50, +821 +], +"eclipse-jetty:jetty-http/src/test/java/org/eclipse/jetty/http/HttpParserTest.java": [ +374, +379, +748 +], +"eclipse-jetty:jetty-http/src/test/java/org/eclipse/jetty/http/pathmap/UriTemplatePathSpecBadSpecsTest.java": [ +36 +], +"eclipse-jetty:jetty-io/src/main/java/org/eclipse/jetty/io/WriteFlusher.java": [ +50 +], +"eclipse-jetty:jetty-server/src/main/java/org/eclipse/jetty/server/ProxyConnectionFactory.java": [ +374 +], +"eclipse-jetty:jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHttpOutputInterceptor.java": [ +47 +], +"eclipse-jetty:jetty-server/src/test/java/org/eclipse/jetty/server/HttpChannelEventTest.java": [ +111 +], +"eclipse-jetty:jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestBase.java": [ +598, +630 +], +"eclipse-jetty:jetty-server/src/test/java/org/eclipse/jetty/server/MultiPartParserTest.java": [ +477 +] +} diff --git a/its/ruling/src/test/resources/expected/eclipse-jetty/java-S9439.json b/its/ruling/src/test/resources/expected/eclipse-jetty/java-S9439.json new file mode 100644 index 00000000000..b275233d73e --- /dev/null +++ b/its/ruling/src/test/resources/expected/eclipse-jetty/java-S9439.json @@ -0,0 +1,106 @@ +{ +"eclipse-jetty:jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java": [ +50, +821 +], +"eclipse-jetty:jetty-http/src/test/java/org/eclipse/jetty/http/HttpParserTest.java": [ +374, +379, +748 +], +"eclipse-jetty:jetty-http/src/test/java/org/eclipse/jetty/http/pathmap/UriTemplatePathSpecBadSpecsTest.java": [ +36 +], +"eclipse-jetty:jetty-io/src/main/java/org/eclipse/jetty/io/WriteFlusher.java": [ +50 +], +"eclipse-jetty:jetty-server/src/main/java/org/eclipse/jetty/server/ProxyConnectionFactory.java": [ +374 +], +"eclipse-jetty:jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHttpOutputInterceptor.java": [ +47 +], +"eclipse-jetty:jetty-server/src/test/java/org/eclipse/jetty/server/HttpChannelEventTest.java": [ +111 +], +"eclipse-jetty:jetty-server/src/test/java/org/eclipse/jetty/server/HttpServerTestBase.java": [ +598, +630 +], +"eclipse-jetty:jetty-server/src/test/java/org/eclipse/jetty/server/MultiPartParserTest.java": [ +477 +], +"eclipse-jetty:jetty-server/src/test/java/org/eclipse/jetty/server/ProxyProtocolTest.java": [ +124, +125 +], +"eclipse-jetty:jetty-server/src/test/java/org/eclipse/jetty/server/ResponseTest.java": [ +957, +958, +1034, +1035, +1361, +1434 +], +"eclipse-jetty:jetty-server/src/test/java/org/eclipse/jetty/server/handler/ContextHandlerCollectionTest.java": [ +104 +], +"eclipse-jetty:jetty-server/src/test/java/org/eclipse/jetty/server/handler/InetAccessHandlerTest.java": [ +149, +165 +], +"eclipse-jetty:jetty-server/src/test/java/org/eclipse/jetty/server/handler/SecuredRedirectHandlerTest.java": [ +100 +], +"eclipse-jetty:jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SelectChannelServerSslTest.java": [ +193 +], +"eclipse-jetty:jetty-util/src/main/java/org/eclipse/jetty/util/Utf8Appendable.java": [ +56 +], +"eclipse-jetty:jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java": [ +56, +57 +], +"eclipse-jetty:jetty-util/src/test/java/org/eclipse/jetty/util/LazyListTest.java": [ +450, +467, +520, +536, +597, +618, +684, +706, +1863, +1878, +1895, +2014, +2037, +2102, +2121 +], +"eclipse-jetty:jetty-util/src/test/java/org/eclipse/jetty/util/SearchPatternTest.java": [ +227 +], +"eclipse-jetty:jetty-util/src/test/java/org/eclipse/jetty/util/TrieTest.java": [ +86 +], +"eclipse-jetty:jetty-util/src/test/java/org/eclipse/jetty/util/URIUtilTest.java": [ +680 +], +"eclipse-jetty:jetty-util/src/test/java/org/eclipse/jetty/util/URLEncodedTest.java": [ +171 +], +"eclipse-jetty:jetty-util/src/test/java/org/eclipse/jetty/util/Utf8AppendableTest.java": [ +260 +], +"eclipse-jetty:jetty-util/src/test/java/org/eclipse/jetty/util/resource/JarResourceTest.java": [ +205, +233, +257 +], +"eclipse-jetty:jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlConfigurationTest.java": [ +1306, +1335 +] +} diff --git a/its/ruling/src/test/resources/expected/sonarqube-6.5/java-S9439.json b/its/ruling/src/test/resources/expected/sonarqube-6.5/java-S9439.json new file mode 100644 index 00000000000..cfb82027075 --- /dev/null +++ b/its/ruling/src/test/resources/expected/sonarqube-6.5/java-S9439.json @@ -0,0 +1,57 @@ +{ +"sonarqube-6.5:src/main/java/org/sonar/server/computation/task/projectanalysis/api/measurecomputer/MeasureComputerDefinitionImpl.java": [ +85 +], +"sonarqube-6.5:src/main/java/org/sonar/server/computation/task/projectanalysis/step/LanguageDistributionMeasuresStep.java": [ +58 +], +"sonarqube-6.5:src/main/java/org/sonar/server/computation/task/projectanalysis/step/NewSizeMeasuresStep.java": [ +169 +], +"sonarqube-6.5:src/main/java/org/sonar/server/computation/task/projectanalysis/step/UnitTestMeasuresStep.java": [ +53 +], +"sonarqube-6.5:src/main/java/org/sonar/server/measure/index/ProjectMeasuresIndex.java": [ +112, +113, +114 +], +"sonarqube-6.5:src/main/java/org/sonar/server/plugins/ServerPluginRepository.java": [ +78 +], +"sonarqube-6.5:src/main/java/org/sonar/server/rule/ws/SearchAction.java": [ +106 +], +"sonarqube-6.5:src/test/java/org/sonar/server/computation/task/projectanalysis/qualitymodel/MaintainabilityMeasuresVisitorTest.java": [ +69 +], +"sonarqube-6.5:src/test/java/org/sonar/server/computation/task/projectanalysis/qualitymodel/NewMaintainabilityMeasuresVisitorTest.java": [ +68 +], +"sonarqube-6.5:src/test/java/org/sonar/server/computation/task/projectanalysis/qualitymodel/RatingGridTest.java": [ +44 +], +"sonarqube-6.5:src/test/java/org/sonar/server/computation/task/projectanalysis/source/HighlightingLineReaderTest.java": [ +126 +], +"sonarqube-6.5:src/test/java/org/sonar/server/computation/task/projectanalysis/step/LoadMeasureComputersStepTest.java": [ +61, +70, +85, +105, +122, +132, +142, +149, +177, +187, +221 +], +"sonarqube-6.5:src/test/java/org/sonar/server/platform/web/WebPagesFilterTest.java": [ +179 +], +"sonarqube-6.5:src/test/java/org/sonar/server/qualityprofile/QProfileExportersTest.java": [ +74, +76 +] +}