From fa9fe66b0cb1b6ab8d7f341cc1f7908897a9cf33 Mon Sep 17 00:00:00 2001 From: benzonico Date: Fri, 21 Jul 2017 16:18:57 +0200 Subject: [PATCH] SONARJAVA-2376 Update rule descriptions (#1597) --- .../l10n/java/rules/squid/S1120_java.html | 3 +- .../l10n/java/rules/squid/S1172_java.html | 11 +++++-- .../l10n/java/rules/squid/S1449_java.json | 2 +- .../l10n/java/rules/squid/S1751_java.json | 2 +- .../l10n/java/rules/squid/S1948_java.json | 2 +- .../l10n/java/rules/squid/S2095_java.html | 29 ++++++++++--------- .../l10n/java/rules/squid/S2134_java.html | 13 +++++++++ .../l10n/java/rules/squid/S2225_java.html | 2 ++ .../l10n/java/rules/squid/S2225_java.json | 6 ++-- .../l10n/java/rules/squid/S2390_java.html | 18 ++++++++---- .../l10n/java/rules/squid/S2390_java.json | 6 ++-- .../l10n/java/rules/squid/S2444_java.json | 4 +-- .../l10n/java/rules/squid/S2447_java.html | 6 ++++ .../l10n/java/rules/squid/S2447_java.json | 6 ++++ .../l10n/java/rules/squid/S2629_java.html | 4 +++ .../l10n/java/rules/squid/S2637_java.html | 6 ++++ .../l10n/java/rules/squid/S2637_java.json | 7 ++++- .../l10n/java/rules/squid/S2693_java.html | 5 ++++ .../l10n/java/rules/squid/S2693_java.json | 4 +++ .../l10n/java/rules/squid/S2699_java.html | 6 ++-- .../l10n/java/rules/squid/S3010_java.json | 2 +- .../l10n/java/rules/squid/S3400_java.html | 4 +-- .../l10n/java/rules/squid/S3437_java.html | 2 +- .../l10n/java/rules/squid/S3958_java.html | 2 +- .../l10n/java/rules/squid/S3958_java.json | 2 +- .../l10n/java/rules/squid/S3959_java.html | 2 +- .../l10n/java/rules/squid/S3959_java.json | 2 +- .../l10n/java/rules/squid/S4034_java.html | 1 + .../l10n/java/rules/squid/S4034_java.json | 2 +- 29 files changed, 116 insertions(+), 45 deletions(-) diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1120_java.html b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1120_java.html index fec16f67e8b..ee8aaf2a3e2 100644 --- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1120_java.html +++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1120_java.html @@ -1,7 +1,6 @@

Proper indentation is a simple and effective way to improve the code's readability. Consistent indentation among the developers within a team also reduces the differences that are committed to source control systems, making code reviews easier.

-

By default this rule checks that each block of code is indented, although it does not check the size of the indent. Parameter "indentSize" allows -the expected indent size to be defined. Only the first line of a badly indented section is reported.

+

This rule raises an issue when indentation does not match the configured value. Only the first line of a badly indented section is reported.

Noncompliant Code Example

With an indent size of 2:

diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1172_java.html b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1172_java.html
index 2cf1b8b4025..5dff0661d7d 100644
--- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1172_java.html
+++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1172_java.html
@@ -12,8 +12,15 @@ 

Compliant Solution

}

Exceptions

-

Override and implementation methods are excluded, as are parameters annotated with @Observes, and methods that are intended to be -overridden.

+

The rule will not raise issues for unused parameters:

+
 @Override
 void doSomething(int a, int b) {     // no issue reported on b
diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1449_java.json b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1449_java.json
index 24c09b0326a..2c87caaf3f7 100644
--- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1449_java.json
+++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1449_java.json
@@ -1,6 +1,6 @@
 {
   "title": "Locale should be used in String operations",
-  "type": "BUG",
+  "type": "CODE_SMELL",
   "status": "ready",
   "remediation": {
     "func": "Constant\/Issue",
diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1751_java.json b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1751_java.json
index 57fdd6a70c7..5c42ab8b256 100644
--- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1751_java.json
+++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1751_java.json
@@ -1,6 +1,6 @@
 {
   "title": "Jump statements should not be used unconditionally",
-  "type": "BUG",
+  "type": "CODE_SMELL",
   "status": "ready",
   "remediation": {
     "func": "Constant\/Issue",
diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1948_java.json b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1948_java.json
index 4d3b3fe079b..979fee9beec 100644
--- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1948_java.json
+++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1948_java.json
@@ -1,6 +1,6 @@
 {
   "title": "Fields in a \"Serializable\" class should either be transient or serializable",
-  "type": "BUG",
+  "type": "CODE_SMELL",
   "status": "ready",
   "remediation": {
     "func": "Constant\/Issue",
diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2095_java.html b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2095_java.html
index d33b696e0bc..31b3fcf22ec 100644
--- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2095_java.html
+++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2095_java.html
@@ -1,6 +1,7 @@
-

Java's garbage collection cannot be relied on to clean up everything. Specifically, connections, streams, files and other classes that implement -the Closeable interface or its super-interface, AutoCloseable, must be manually closed after creation. Further, that -close call must be made in a finally block, otherwise an exception could keep the call from being made.

+

Connections, streams, files, and other classes that implement the Closeable interface or its super-interface, +AutoCloseable, needs to be closed after use. Further, that close call must be made in a finally block otherwise +an exception could keep the call from being made. Preferably, when class implements AutoCloseable, resource should be created using +"try-with-resources" pattern and will be closed automatically.

Failure to properly close resources will result in a resource leak which could bring first the application and then perhaps the box it's on to their knees.

Noncompliant Code Example

@@ -10,6 +11,8 @@

Noncompliant Code Example

BufferedReader reader = Files.newBufferedReader(path, this.charset)) { // ... reader.close(); // Noncompliant + // ... + Files.lines("input.txt").forEach(System.out::println); // Noncompliant: The stream needs to be closed } private void doSomething() { @@ -28,17 +31,16 @@

Noncompliant Code Example

Compliant Solution

-private void readTheFile() throws IOException {
-  Path path = Paths.get(this.fileName);
-  BufferedReader reader = null;
-  try {
-    reader = Files.newBufferedReader(path, this.charset)) {
-    // ...
-  } finally {
-    if (reader != null) {
-      reader.close();
+private void readTheFile(String fileName) throws IOException {
+    Path path = Paths.get(fileName);
+    try (BufferedReader reader = Files.newBufferedReader(path, StandardCharsets.UTF_8)) {
+      reader.readLine();
+      // ...
+    }
+    // ..
+    try (Stream<String> input = Files.lines("input.txt"))  {
+      input.forEach(System.out::println);
     }
-  }
 }
 
 private void doSomething() {
@@ -71,5 +73,6 @@ 

See

  • MITRE, CWE-459 - Incomplete Cleanup
  • CERT, FIO04-J. - Release resources when they are no longer needed
  • CERT, FIO42-C. - Close files when they are no longer needed
  • +
  • Try With Resources
  • diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2134_java.html b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2134_java.html index 0f2fa03bc0c..42ebe35c5fd 100644 --- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2134_java.html +++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2134_java.html @@ -14,4 +14,17 @@

    Noncompliant Code Example

    public void doSometing() {...} }
    +

    Exceptions

    +

    If run() is not overridden in a class extending Thread, it means that starting the thread will actually call +Thread.run(). However, Thread.run() does nothing if it has not been fed with a target Runnable. The rule +consequently ignore classes extending Thread if they are calling, in their constructors, the super(...) constructor with a +proper Runnable target.

    +
    +class MyThread extends Thread { // Compliant - calling super constructor with a Runnable
    +  MyThread(Runnable target) {
    +    super(target); // calling super constructor with a Runnable, which will be used for when Thread.run() is executed
    +    // ...
    +  }
    +}
    +
    diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2225_java.html b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2225_java.html index 22ffc4c2379..0fa2f6503f7 100644 --- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2225_java.html +++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2225_java.html @@ -20,5 +20,7 @@

    Compliant Solution

    See

    diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2225_java.json b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2225_java.json index 4bf4b4ba01c..30d1c4b6bf1 100644 --- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2225_java.json +++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2225_java.json @@ -7,10 +7,12 @@ "constantCost": "5min" }, "tags": [ - "cwe" + "cwe", + "cert" ], "standards": [ - "CWE" + "CWE", + "CERT" ], "defaultSeverity": "Major" } diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2390_java.html b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2390_java.html index db9e3dd6664..c36dac5806d 100644 --- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2390_java.html +++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2390_java.html @@ -1,15 +1,21 @@ -

    When a parent class references a static member of a subclass during its own initialization, the results will not be what you expect because the -child class won't exist yet.

    -

    In a best-case scenario, you'll see immediate failures in the code as a result. Worst-case, the damage will be more insidious and difficult to -track down.

    +

    When a parent class references a member of a subclass during its own initialization, the results might not be what you expect because the child +class might not have been initialized yet. This could create what is known as an "initialisation cycle", or even a deadlock in some extreme cases.

    +

    To make things worse, these issues are very hard to diagnose so it is highly recommended you avoid creating this kind of dependencies.

    Noncompliant Code Example

     class Parent {
    -  public static final int childVersion = Child.version;
    +  static int field1 = Child.method(); // Noncompliant
    +  static int field2 = 42;
    +
    +  public static void main(String[] args) {
    +    System.out.println(Parent.field1); // will display "0" instead of "42"
    +  }
     }
     
     class Child extends Parent {
    -  public static final int version = 6;
    +  static int method() {
    +    return Parent.field2;
    +  }
     }
     

    See

    diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2390_java.json b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2390_java.json index 0ae2c6f44d8..543938260ed 100644 --- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2390_java.json +++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2390_java.json @@ -1,6 +1,6 @@ { - "title": "Classes should not access static members of their own subclasses during initialization", - "type": "BUG", + "title": "Classes should not access their own subclasses during initialization", + "type": "CODE_SMELL", "status": "ready", "remediation": { "func": "Constant\/Issue", @@ -12,5 +12,5 @@ "standards": [ "CERT" ], - "defaultSeverity": "Major" + "defaultSeverity": "Critical" } diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2444_java.json b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2444_java.json index 037a2df326e..c037dfa3b17 100644 --- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2444_java.json +++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2444_java.json @@ -1,6 +1,6 @@ { "title": "Lazy initialization of \"static\" fields should be \"synchronized\"", - "type": "BUG", + "type": "CODE_SMELL", "status": "ready", "remediation": { "func": "Constant\/Issue", @@ -9,5 +9,5 @@ "tags": [ "multi-threading" ], - "defaultSeverity": "Major" + "defaultSeverity": "Critical" } diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2447_java.html b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2447_java.html index 104e3c42c07..f2791b81c13 100644 --- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2447_java.html +++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2447_java.html @@ -8,4 +8,10 @@

    Noncompliant Code Example

    return null; // Noncompliant } +

    See

    + diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2447_java.json b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2447_java.json index b286ad7aa67..a08c12f8379 100644 --- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2447_java.json +++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2447_java.json @@ -7,7 +7,13 @@ "constantCost": "20min" }, "tags": [ + "cwe", + "cert", "pitfall" ], + "standards": [ + "CWE", + "CERT" + ], "defaultSeverity": "Critical" } diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2629_java.html b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2629_java.html index c8c202bc08d..57fd678253b 100644 --- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2629_java.html +++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2629_java.html @@ -10,6 +10,8 @@

    Noncompliant Code Example

     logger.log(Level.DEBUG, "Something went wrong: " + message);  // Noncompliant; string concatenation performed even when log level too high to show DEBUG messages
     
    +logger.fine("An exception occurred with message: " + message); // Noncompliant
    +
     LOG.error("Unable to open file " + csvPath, e);  // Noncompliant
     
     Preconditions.checkState(a > 0, "Arg must be positive, but got " + a);  // Noncompliant. String concatenation performed even when a > 0
    @@ -22,6 +24,8 @@ 

    Compliant Solution

     logger.log(Level.SEVERE, "Something went wrong: %s ", message);  // String formatting only applied if needed
     
    +logger.log(Level.FINE, "An exception occurred with message: {}", message);
    +
     logger.log(Level.SEVERE, () -> "Something went wrong: " + message); // since Java 8, we can use Supplier , which will be evaluated lazily
     
     LOG.error("Unable to open file {}", csvPath, e);
    diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2637_java.html b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2637_java.html
    index e3631474888..fcc949d6c9a 100644
    --- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2637_java.html
    +++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2637_java.html
    @@ -25,4 +25,10 @@ 

    Noncompliant Code Example

    return mix; // Noncompliant; return value is Nonnull, but null is returned.}} }
    +

    See

    + diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2637_java.json b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2637_java.json index 88ee3d650ae..27406771334 100644 --- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2637_java.json +++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2637_java.json @@ -7,7 +7,12 @@ "constantCost": "15min" }, "tags": [ - + "cwe", + "cert" + ], + "standards": [ + "CWE", + "CERT" ], "defaultSeverity": "Minor" } diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2693_java.html b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2693_java.html index 0415a168788..8acd1763021 100644 --- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2693_java.html +++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2693_java.html @@ -13,4 +13,9 @@

    Noncompliant Code Example

    } }
    +

    See

    + diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2693_java.json b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2693_java.json index 67ee8d425ea..392ec95dfca 100644 --- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2693_java.json +++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2693_java.json @@ -8,7 +8,11 @@ }, "tags": [ "multi-threading", + "cert", "pitfall" ], + "standards": [ + "CERT" + ], "defaultSeverity": "Blocker" } diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2699_java.html b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2699_java.html index 6dd20bc00e0..96e175c705d 100644 --- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2699_java.html +++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S2699_java.html @@ -8,10 +8,12 @@
  • Rest-assured 2.0
  • AssertJ
  • Hamcrest
  • -
  • Mockito
  • Spring's org.springframework.test.web.servlet.ResultActions.andExpect()
  • -
  • EasyMock
  • Truth Framework
  • +
  • Mockito
  • +
  • EasyMock
  • +
  • JMock
  • +
  • WireMock
  • Noncompliant Code Example

    diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3010_java.json b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3010_java.json
    index 2359262ed06..8ce0e4f4da4 100644
    --- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3010_java.json
    +++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3010_java.json
    @@ -1,6 +1,6 @@
     {
       "title": "Static fields should not be updated in constructors",
    -  "type": "BUG",
    +  "type": "CODE_SMELL",
       "status": "ready",
       "remediation": {
         "func": "Constant\/Issue",
    diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3400_java.html b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3400_java.html
    index 96aba0e336e..e3f46b74fc5 100644
    --- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3400_java.html
    +++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3400_java.html
    @@ -3,13 +3,13 @@
     

    This rule raises an issue if on methods that contain only one statement: the return of a constant value.

    Noncompliant Code Example

    -public int getBestNumber() {
    +int getBestNumber() {
       return 12;  // Noncompliant
     }
     

    Compliant Solution

    -public static int bestNumber = 12;
    +static int bestNumber = 12;
     

    Exceptions

    Methods with annotations, such as @Override and Spring's @RequestMapping, are ignored.

    diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3437_java.html b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3437_java.html index 02c48578639..b47a3a0e549 100644 --- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3437_java.html +++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3437_java.html @@ -20,7 +20,7 @@ value types are introduced in the language.

    This rule raises an issue when a Serializable class defines a non-transient, non-static field field whose type is a known serializable value-based class. Known serializable value-based classes are: all the classes in the java.time package except Clock; the -date classes for alternate calendars: HijrahDate, JapaneseDate, MinguaDate, ThaiBuddhistDate.

    +date classes for alternate calendars: HijrahDate, JapaneseDate, MinguoDate, ThaiBuddhistDate.

    Noncompliant Code Example

     class MyClass implements Serializable {
    diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3958_java.html b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3958_java.html
    index 2d0c3793142..a839bb75228 100644
    --- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3958_java.html
    +++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3958_java.html
    @@ -19,4 +19,4 @@ 

    Compliant Solution

    See

    Stream Operations

    - + diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3958_java.json b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3958_java.json index 4cfd57de3d8..93acfdc481b 100644 --- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3958_java.json +++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3958_java.json @@ -10,4 +10,4 @@ "java8" ], "defaultSeverity": "Major" -} +} diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3959_java.html b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3959_java.html index 25f294f51f8..fa17a417d5c 100644 --- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3959_java.html +++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3959_java.html @@ -8,4 +8,4 @@

    Noncompliant Code Example

    See

    Stream Operations

    - + diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3959_java.json b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3959_java.json index a70bb6d4ad5..d5c10f40b23 100644 --- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3959_java.json +++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S3959_java.json @@ -10,4 +10,4 @@ "java8" ], "defaultSeverity": "Major" -} +} diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S4034_java.html b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S4034_java.html index 4ab9b900420..647fad8b90f 100644 --- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S4034_java.html +++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S4034_java.html @@ -13,3 +13,4 @@

    Compliant Solution

     boolean hasRed = widgets.stream().anyMatch(w -> w.getColor() == RED);
     
    + diff --git a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S4034_java.json b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S4034_java.json index e4537851168..ee7b3dd7e26 100644 --- a/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S4034_java.json +++ b/java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S4034_java.json @@ -10,4 +10,4 @@ "clumsy" ], "defaultSeverity": "Minor" -} \ No newline at end of file +}