GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [java] Error processing identifiers with Unicode · Issue #3423 · pmd/pmd

[java] Error processing identifiers with Unicode #3423

New issue
Copy link
New issue
Copy link
Closed
#3946
Closed
[java] Error processing identifiers with Unicode#3423
#3946
Copy link
Labels
a:bugPMD crashes or fails to analyse a file.in:grammarAbout the grammar of a lexer or parser, eg, a parse/lex exception
Milestone
6.46.0

Description

@njdoyle
njdoyle
opened on Jul 27, 2021
Issue body actions

Affects PMD Version:

6.36.0

Description:

PMD fails to analyze Java source with variables named with Unicode characters. Additionally, I think this is causing Eclipse to entirely crash when this is encountered (as opposed to failing more gracefully) while using the com.basistech.m2e.code.quality.pmd plugin but I'm not certain how to diagnose this specifically.

This is likely related to the following issues but I created this issues for Java specifically and to mention the Eclipse crash:

  • [go] Error parsing unicode values #2752
  • [js] Support unicode characters #2605
  • [python] Support unicode identifiers #2604
  • [cpp] Support unicode characters #1757

Exception Stacktrace:

net.sourceforge.pmd.PMDException: Error while processing /home/nidoyle/Work/Source/PmdTest/src/main/java/com/example/pmdtest/PmdTest.java
	at net.sourceforge.pmd.SourceCodeProcessor.processSourceCodeWithoutCache(SourceCodeProcessor.java:119)
	at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:95)
	at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:57)
	at net.sourceforge.pmd.processor.PmdRunnable.call(PmdRunnable.java:85)
	at net.sourceforge.pmd.processor.PmdRunnable.call(PmdRunnable.java:29)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: net.sourceforge.pmd.lang.ast.TokenMgrError: Lexical error at line 5, column 28.  Encountered: "\u1d64" (7524), after : "" (in lexical state 0)
	at net.sourceforge.pmd.lang.java.ast.JavaParserTokenManager.getNextToken(JavaParserTokenManager.java:2377)
	at net.sourceforge.pmd.lang.java.ast.JavaParser.jj_scan_token(JavaParser.java:13219)
	at net.sourceforge.pmd.lang.java.ast.JavaParser.jj_3R_126(JavaParser.java:9270)
	at net.sourceforge.pmd.lang.java.ast.JavaParser.jj_3_13(JavaParser.java:9421)
	at net.sourceforge.pmd.lang.java.ast.JavaParser.jj_2_13(JavaParser.java:7931)
	at net.sourceforge.pmd.lang.java.ast.JavaParser.ClassOrInterfaceBodyDeclaration(JavaParser.java:1782)
	at net.sourceforge.pmd.lang.java.ast.JavaParser.ClassOrInterfaceBody(JavaParser.java:1738)
	at net.sourceforge.pmd.lang.java.ast.JavaParser.ClassOrInterfaceDeclaration(JavaParser.java:879)
	at net.sourceforge.pmd.lang.java.ast.JavaParser.TypeDeclaration(JavaParser.java:781)
	at net.sourceforge.pmd.lang.java.ast.JavaParser.CompilationUnit(JavaParser.java:501)
	at net.sourceforge.pmd.lang.java.AbstractJavaParser.parse(AbstractJavaParser.java:62)
	at net.sourceforge.pmd.SourceCodeProcessor.parse(SourceCodeProcessor.java:127)
	at net.sourceforge.pmd.SourceCodeProcessor.processSource(SourceCodeProcessor.java:191)
	at net.sourceforge.pmd.SourceCodeProcessor.processSourceCodeWithoutCache(SourceCodeProcessor.java:113)
	... 10 more

Code Sample demonstrating the issue:

package com.example.pmdtest;

public class PmdTest {

	private static final int lᵤ = 1;
	private static final int μᵤ = 2;

	public static void main(String[] args) {
		System.out.println(lᵤ + μᵤ);
	}

}

Steps to reproduce:

Please provide detailed steps for how we can reproduce the bug.

  1. mvn clean verify

Running PMD through: [Maven]

Activity

  1. njdoyle
    added
    a:bugPMD crashes or fails to analyse a file.
    on Jul 27, 2021
  2. msakamoto-sf
    added a commit that references this issue on Aug 8, 2021

    exclude EncodePojo.java from pmd check.

    e6be91c
  3. oowekyala
    added
    in:grammarAbout the grammar of a lexer or parser, eg, a parse/lex exception
    on May 1, 2022
  4. oowekyala
    added this to the 6.46.0 milestone on May 1, 2022
  5. oowekyala
    added a commit that references this issue on May 1, 2022

    Allow Phonetic Extensions block in java

    This issue will close once commit 98f44b7 is merged into the 'main' branch.
    98f44b7
  6. adangel
    closed this as completedin 98f44b7on May 26, 2022
  7. adangel
    closed this as completedin #3946on May 26, 2022
  8. adangel
    added a commit that references this issue on May 26, 2022

    [doc] Update release notes (pmd#3946, pmd#3423, pmd#2605, pmd#2604, p…

    aae06c4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a:bugPMD crashes or fails to analyse a file.in:grammarAbout the grammar of a lexer or parser, eg, a parse/lex exception

    Type

    No type

    Projects

    No projects

      Milestone

      • 6.46.0

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.