A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/4947 below:

[java] Broken TextBlock parser · Issue #4947 · pmd/pmd · GitHub

Affects PMD Version:

7.0.0

Description:

Parse exception in text block, if followed by a String template.

Exception Stacktrace:

ImageRecorder.java      -       ParseException: Parse exception in file 
'ImageRecorder.java' at line 2, column 21: Encountered 
<TEXT_BLOCK_TEMPLATE_BEGIN: "\"\"\"\n                    x\"\"\";\n\n//     STR.\"\\{">.
Was expecting:
    "{" ...
[main] INFO net.sourceforge.pmd.cli - An error occurred while executing PMD.

Code Sample demonstrating the issue:

public class ImageRecorder {
  String digits = """
                  x""";
  //     STR."\{1}");
}

Steps to reproduce:

java -cp "lib/*" net.sourceforge.pmd.cli.PmdCli check --verbose  --no-progress --no-cache --use-version java-22-preview -R ruleset.xml -d ImageRecorder.java

Running PMD through: CLI

ruleset.xml:

<?xml version="1.0"?>
<ruleset name="sample">
<description/>
<rule ref="category/java/errorprone.xml"/>
</ruleset>

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4