Missing space in string literal¶
ID: java/missing-space-in-concatenation Kind: problem Severity: recommendation Precision: very-high Tags: - readability Query suites: - java-security-and-quality.qls
Splitting a long string literal over multiple lines can often aid readability, but this also makes it difficult to notice whether a space is missing where the strings are concatenated.
Check the string literal to see whether it has the intended text. In particular, look for missing spaces near line breaks.
The following example shows a text literal that is split over two lines and omits a space character between the two words at the line break.
String s = "This text is" + "missing a space.";
Java Language Specification: String Literals.