rspec/rules/S1710/rule.adoc
Arseniy Zaostrovnykh 7ca29f686f Force linebreaks
2021-02-02 15:02:10 +01:00

32 lines
661 B
Plaintext

Before Java 8 if you needed to use multiple instances of the same annotation, they had to be wrapped in a container annotation. With Java 8, that's no longer necessary, allowing for cleaner, more readable code.
*Note* that this rule is automatically disabled when the project's ``++sonar.java.source++`` is lower than ``++8++``.
== Noncompliant Code Example
----
@SomeAnnotations({ // Noncompliant
@SomeAnnotation(..a..),
@SomeAnnotation(..b..),
@SomeAnnotation(..c..),
})
public class SomeClass {
...
}
----
== Compliant Solution
----
@SomeAnnotation(..a..)
@SomeAnnotation(..b..)
@SomeAnnotation(..c..)
public class SomeClass {
...
}
----