
org.sonar.l10n.java.rules.java.S5665.html Maven / Gradle / Ivy
Why is this an issue?
The use of escape sequences is mostly unnecessary in text blocks.
Noncompliant code example
\n
can be replaced by simply introducing the newline, \"\"\"
it is sufficient to escape only the first qoute.
String textBlock = """
\"\"\" this \nis
text block!
!!!!
""";
Compliant solution
String textBlock = """
\""" this
is
text block!
!!!!
""";
Resources
- JEP 378: Text Blocks
- Programmer’s Guide To Text Blocks, by Jim Laskey and Stuart Marks
© 2015 - 2025 Weber Informatics LLC | Privacy Policy