The compiler trims incidental whitespace to align with the least indented line.
When you use text blocks, the compiler automatically trims leading whitespace to match the least indented line, ensuring consistent formatting. This avoids unexpected white spaces in your output. For instance, if all lines in a text block start with the same indentation, the compiler will trim it out, maintaining neat code alignment.
Additional Notes
How does the Java compiler manage incidental whitespace in text blocks?