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 — [apex] Exception applying rule UnusedLocalVariable on trigger · Issue #2554 · pmd/pmd

[apex] Exception applying rule UnusedLocalVariable on trigger #2554

New issue
Copy link
New issue
Copy link
Closed
#2556
Closed
[apex] Exception applying rule UnusedLocalVariable on trigger#2554
#2556
Copy link
Labels
a:bugPMD crashes or fails to analyse a file.
Milestone
6.25.0

Description

@ankushsomani09
ankushsomani09
opened on May 29, 2020
Issue body actions

Executed by : ant
Apex language : trigger code
Rule name: UnusedLocalVariable subset of

<rule ref="category/apex/bestpractices.xml" />

code:
trigger leadOwnerUpdate on Lead (after update) { for(Lead Id : Trigger.new) {} }

Error:

Exception applying rule UnusedLocalVariable on file E:\writable\OneDrive\OneDrive - ANkush\Documents\sfdc\src\triggers\leadOwnerUpdate.trigger, continuing with next rule
java.lang.NullPointerException
        at net.sourceforge.pmd.lang.apex.rule.bestpractices.UnusedLocalVariableRule.visit(UnusedLocalVariableRule.java:31)
        at net.sourceforge.pmd.lang.apex.ast.ASTVariableDeclaration.jjtAccept(ASTVariableDeclaration.java:22)
        at net.sourceforge.pmd.lang.apex.rule.ApexRuleChainVisitor.visit(ApexRuleChainVisitor.java:42)
        at net.sourceforge.pmd.lang.rule.AbstractRuleChainVisitor.visitAll(AbstractRuleChainVisitor.java:96)
        at net.sourceforge.pmd.RuleChain.apply(RuleChain.java:67)
        at net.sourceforge.pmd.RuleSets.apply(RuleSets.java:140)
        at net.sourceforge.pmd.SourceCodeProcessor.processSource(SourceCodeProcessor.java:194)
        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.MonoThreadProcessor.runAnalysis(MonoThreadProcessor.java:29)
        at net.sourceforge.pmd.processor.AbstractPMDProcessor.processFiles(AbstractPMDProcessor.java:122)
        at net.sourceforge.pmd.PMD.processFiles(PMD.java:310)
        at net.sourceforge.pmd.ant.internal.PMDTaskImpl.doTask(PMDTaskImpl.java:196)
        at net.sourceforge.pmd.ant.internal.PMDTaskImpl.execute(PMDTaskImpl.java:281)
        at net.sourceforge.pmd.ant.PMDTask.execute(PMDTask.java:50)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:352)
        at org.apache.tools.ant.Target.execute(Target.java:437)
        at org.apache.tools.ant.Target.performTasks(Target.java:458)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1406)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1377)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1261)
        at org.apache.tools.ant.Main.runBuild(Main.java:857)
        at org.apache.tools.ant.Main.startAnt(Main.java:236)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:287)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:112)

Activity

  1. adangel
    changed the title [-]Exception applying rule UnusedLocalVariable on file[/-] [+][apex] Exception applying rule UnusedLocalVariable on file[/+] on May 29, 2020
  2. adangel
    added
    a:bugPMD crashes or fails to analyse a file.
    on May 29, 2020
  3. adangel
    changed the title [-][apex] Exception applying rule UnusedLocalVariable on file[/-] [+][apex] Exception applying rule UnusedLocalVariable on trigger[/+] on May 30, 2020
  4. adangel
    added a commit that references this issue on May 30, 2020

    [apex] Exception applying rule UnusedLocalVariable on trigger

    This issue will close once commit c680b26 is merged into the 'main' branch.
    c680b26
  5. adangel
    added this to the 6.25.0 milestone on May 30, 2020
  6. adangel
    added
    has:pr
    on May 30, 2020
  7. adangel
    closed this as completedin c680b26on Jun 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.25.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.