
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
36 lines
861 B
Plaintext
36 lines
861 B
Plaintext
== Why is this an issue?
|
|
|
|
Different formatters use different formatting symbols, and it can be easy to confuse one for the other. But get it wrong, and your output may be useless.
|
|
|
|
|
|
This rule logs an issue when the wrong type of format string is used for Guava, slf4j, logback or ``++MessageFormat++`` strings.
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,java]
|
|
----
|
|
String message = MessageFormat.format("Now is the %s %d all good people", "time", 4); // Noncompliant
|
|
----
|
|
|
|
|
|
=== Compliant solution
|
|
|
|
[source,java]
|
|
----
|
|
String message = MessageFormat.format("Now is the {1} {2} all good people", "time", 4); // Noncompliant
|
|
----
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
=== Message
|
|
|
|
Use "x" instead of "y" to format this [Guava|slf4j|logback|MessageFormat] message.
|
|
|
|
|
|
endif::env-github,rspecator-view[]
|