Uploaded image for project: 'Maven Checkstyle Plugin'
  1. Maven Checkstyle Plugin
  2. MCHECKSTYLE-348

Checkstyle plugin fails on Unicode Escapes

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Invalid
    • Affects Version/s: 2.17, 3.0.0
    • Fix Version/s: None
    • Component/s: checkstyle:checkstyle
    • Labels:
      None

      Description

      Checkstyle plugin fails to correctly handle Unicode Escapes https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.3 ).

      This issue was introduced in 2.17. It does not occur with earlier versions of maven-checkstyle-plugin.

      For this code:

      public class Test {
          private String things;
          private String \u06c5;
      }

      The following occurs with checkstyle:checkstyle :

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.17:checkstyle (default-cli) on project checkstyle-bug: An error has occurred in Checkstyle report generation.: Failed during checkstyle configuration: TokenStreamRecognitionException occurred during the analysis of file C:\TEMP\checkstyle-bug\src\main\java\Test.java. unexpected char: '\' -> [Help 1]

      Similarly for 3.0.0, we get the same error:

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.0.0:checkstyle (default-cli) on project checkstyle-bug: An error has occurred in Checkstyle report generation.: Failed during checkstyle configuration: Exception was thrown while processing C:\TEMP\checkstyle-bug\src\main\java\Test.java: TokenStreamRecognitionException occurred during the analysis of file C:\TEMP\checkstyle-bug\src\main\java\Test.java. unexpected char: '\' -> [Help 1]

      For 2.16 and earlier, checkstyle:checkstyle completes without error.

       

        Attachments

        1. 3.0.0-check.log
          45 kB
          Leon K
        2. 2.16-check.log
          149 kB
          Leon K

          Activity

            People

            • Assignee:
              rfscholte Robert Scholte
              Reporter:
              leonk Leon K
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: