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] JavaCharStream throws an Error on invalid escape · Issue #2472 · pmd/pmd

[java] JavaCharStream throws an Error on invalid escape #2472

New issue
Copy link
New issue
Copy link
Closed
#2474
Closed
[java] JavaCharStream throws an Error on invalid escape#2472
#2474
Copy link
Labels
a:bugPMD crashes or fails to analyse a file.
Milestone
6.24.0

Description

@oowekyala
oowekyala
opened on May 7, 2020
Issue body actions

Affects PMD Version: 6.23.0

Description: Javacc throws an Error on invalid escapes, which isn't caught, so it crashes the whole program. It also doesn't mention the filename.

Exception Stacktrace:

Exception in thread "main" java.lang.Error: Invalid escape character at line 1 column 2.
	at net.sourceforge.pmd.lang.ast.JavaCharStream.readChar(JavaCharStream.java:331)
	at net.sourceforge.pmd.lang.ast.JavaCharStream.BeginToken(JavaCharStream.java:193)
	at net.sourceforge.pmd.lang.java.ast.JavaParserTokenManager.getNextToken(JavaParserTokenManager.java:2271)
	at net.sourceforge.pmd.lang.java.ast.JavaParser.<init>(JavaParser.java:12555)
	at net.sourceforge.pmd.lang.java.AbstractJavaParser.createJavaParser(AbstractJavaParser.java:46)
	at net.sourceforge.pmd.lang.java.JavaLanguageParser.createJavaParser(JavaLanguageParser.java:41)
	at net.sourceforge.pmd.lang.java.AbstractJavaParser.parse(AbstractJavaParser.java:62)
	at net.sourceforge.pmd.SourceCodeProcessor.parse(SourceCodeProcessor.java:121)
	at net.sourceforge.pmd.SourceCodeProcessor.processSource(SourceCodeProcessor.java:185)
	at net.sourceforge.pmd.SourceCodeProcessor.processSourceCodeWithoutCache(SourceCodeProcessor.java:107)
	at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:89)
	at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:51)
	at net.sourceforge.pmd.processor.PmdRunnable.call(PmdRunnable.java:78)
	at net.sourceforge.pmd.processor.PmdRunnable.call(PmdRunnable.java:24)
	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)

Code Sample demonstrating the issue:

\u00k0 // not a valid unicode escape because k is not a valid hex digit 

Steps to reproduce:

  1. analyse a file with an invalid escape like above

Running PMD through: any

Activity

  1. oowekyala
    added
    a:bugPMD crashes or fails to analyse a file.
    has:pr
    on May 7, 2020
  2. oowekyala
    added this to the 6.24.0 milestone on May 7, 2020
  3. adangel
    closed this as completedin ca341e8on May 18, 2020
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.

    Type

    No type

    Projects

    No projects

      Milestone

      • 6.24.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.