Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cli] ast-dump with no properties produce an NPE #4484

Closed
jsotuyod opened this issue Apr 18, 2023 · 0 comments · Fixed by #4485
Closed

[cli] ast-dump with no properties produce an NPE #4484

jsotuyod opened this issue Apr 18, 2023 · 0 comments · Fixed by #4485
Labels
a:bug PMD crashes or fails to analyse a file. in:cli Affects the PMD Command Line Interface
Projects
Milestone

Comments

@jsotuyod
Copy link
Member

Using PMD 7.0.0-rc1 to run:

pmd ast-dump --format xml --language java --file Foo.java > Foo.xml

Produces:

INFO net.sourceforge.pmd.cli.commands.internal.AbstractPmdSubcommand - Log level is at INFO
java.lang.NullPointerException: Cannot invoke "java.util.Properties.entrySet()" because "properties" is null
        at net.sourceforge.pmd.util.treeexport.TreeExporter.parseProperties(TreeExporter.java:106)
        at net.sourceforge.pmd.util.treeexport.TreeExporter.export(TreeExporter.java:53)
        at net.sourceforge.pmd.cli.commands.internal.TreeExportCommand.execute(TreeExportCommand.java:112)
        at net.sourceforge.pmd.cli.commands.internal.AbstractPmdSubcommand.call(AbstractPmdSubcommand.java:35)
        at net.sourceforge.pmd.cli.commands.internal.AbstractPmdSubcommand.call(AbstractPmdSubcommand.java:20)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
        at picocli.CommandLine.access$1500(CommandLine.java:148)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
        at picocli.CommandLine.execute(CommandLine.java:2170)
        at net.sourceforge.pmd.cli.PmdCli.main(PmdCli.java:18)

Originally posted by @Fernal73 in #4481 (comment)

@jsotuyod jsotuyod added a:bug PMD crashes or fails to analyse a file. in:cli Affects the PMD Command Line Interface labels Apr 18, 2023
@jsotuyod jsotuyod added this to the 7.0.0 milestone Apr 18, 2023
adangel added a commit to adangel/pmd that referenced this issue Apr 20, 2023
@adangel adangel added this to Done in PMD 7 Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug PMD crashes or fails to analyse a file. in:cli Affects the PMD Command Line Interface
Projects
No open projects
PMD 7
  
Done
Development

Successfully merging a pull request may close this issue.

1 participant