Back to Intellij Community

TextBlockBackwardMigration

java/java-impl/resources/inspectionDescriptions/TextBlockBackwardMigration.html

2025.3-rc-2682 B
Original Source

Reports text blocks that can be replaced with regular string literals. This may help to downgrade for backward compatibility with earlier Java versions.

Example:

Object obj = engine.eval("""
                           function hello() {
                             print('"Hello, world"');
                           }

                           hello();
                           """);

After the quick fix is applied:

Object obj = engine.eval("function hello() {\n" +
                           " print('\"Hello, world\"');\n" +
                           "}\n" +
                           "\n" +
                           "hello();\n");

New in 2019.3