2021-04-28 16:49:39 +02:00
|
|
|
For optimal code readability, annotation arguments should be specified in the same order that they were declared in the annotation definition.
|
|
|
|
|
2021-04-28 18:08:03 +02:00
|
|
|
|
2021-04-28 16:49:39 +02:00
|
|
|
== Noncompliant Code Example
|
|
|
|
|
|
|
|
----
|
|
|
|
@interface Pet {
|
|
|
|
String name();
|
|
|
|
String surname();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Pet(surname ="", name="") // Noncompliant
|
|
|
|
----
|
|
|
|
|
2021-04-28 18:08:03 +02:00
|
|
|
|
2021-04-28 16:49:39 +02:00
|
|
|
== Compliant Solution
|
|
|
|
|
|
|
|
----
|
|
|
|
@interface Pet {
|
|
|
|
String name();
|
|
|
|
String surname();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Pet(name ="", surname="") // Compliant
|
|
|
|
----
|
2021-04-28 18:08:03 +02:00
|
|
|
|