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 — [plsql] NullPointerException while running parsing test for CREATE TRIGGER · Issue #2325 · pmd/pmd

[plsql] NullPointerException while running parsing test for CREATE TRIGGER #2325

New issue
Copy link
New issue
Copy link
Closed
#2336
Closed
[plsql] NullPointerException while running parsing test for CREATE TRIGGER#2325
#2336
Copy link
Assignees
adangel
Labels
a:bugPMD crashes or fails to analyse a file.
Milestone
6.22.0

Description

@szymanp23
szymanp23
opened on Mar 3, 2020
Issue body actions

Affects PMD Version: 6.21.0

Description: Below error appears when I try to run simple test case for CREATE TRIGGER statement. Code with CREATE TRIGGER is parsed correctly (it can be checked in Designer), but checking it with PMD also results in below exception.

Code Sample demonstrating the issue:

Testcase:
    @Test
    public void parseCreateTrigger() {
        plsql.parseResource("trigger_unit.sql");
    }

trigger_unit.sql:

create or replace trigger test_trigger
instead of update
on test_table
for each row
begin
  test.clr;
end;
/

java.lang.NullPointerException
	at net.sourceforge.pmd.lang.plsql.ast.AbstractPLSQLNode.getScope(AbstractPLSQLNode.java:136)
	at net.sourceforge.pmd.lang.plsql.ast.AbstractPLSQLNode.getScope(AbstractPLSQLNode.java:136)
	at net.sourceforge.pmd.lang.plsql.dfa.VariableAccessVisitor.collectDeclarations(VariableAccessVisitor.java:122)
	at net.sourceforge.pmd.lang.plsql.dfa.VariableAccessVisitor.markUsages(VariableAccessVisitor.java:90)
	at net.sourceforge.pmd.lang.plsql.dfa.VariableAccessVisitor.computeNow(VariableAccessVisitor.java:76)
	at net.sourceforge.pmd.lang.plsql.dfa.VariableAccessVisitor.compute(VariableAccessVisitor.java:61)
	at net.sourceforge.pmd.lang.plsql.dfa.DataFlowFacade.visit(DataFlowFacade.java:79)
	at net.sourceforge.pmd.lang.plsql.ast.ASTTriggerUnit.jjtAccept(ASTTriggerUnit.java:24)
	at net.sourceforge.pmd.lang.plsql.ast.AbstractPLSQLNode.childrenAccept(AbstractPLSQLNode.java:64)
	at net.sourceforge.pmd.lang.plsql.ast.PLSQLParserVisitorAdapter.visit(PLSQLParserVisitorAdapter.java:11)
	at net.sourceforge.pmd.lang.plsql.ast.PLSQLParserVisitorAdapter.visit(PLSQLParserVisitorAdapter.java:16)
	at net.sourceforge.pmd.lang.plsql.ast.ASTInput.jjtAccept(ASTInput.java:25)
	at net.sourceforge.pmd.lang.plsql.dfa.DataFlowFacade.initializeWith(DataFlowFacade.java:36)
	at net.sourceforge.pmd.lang.plsql.PLSQLHandler$1.start(PLSQLHandler.java:60)
	at net.sourceforge.pmd.lang.ast.test.BaseParsingHelper.parse(BaseParsingHelper.kt:116)
	at net.sourceforge.pmd.lang.ast.test.BaseParsingHelper.parseResource(BaseParsingHelper.kt:130)
	at net.sourceforge.pmd.lang.ast.test.BaseParsingHelper.parseResource$default(BaseParsingHelper.kt:129)
	at net.sourceforge.pmd.lang.ast.test.BaseParsingHelper.parseResource(BaseParsingHelper.kt)
	at net.sourceforge.pmd.lang.plsql.ast.ViewTest.parseCreateViewAndTrigger(ViewTest.java:30)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)


Running PMD through: [Maven]

Activity

  1. adangel
    added
    a:bugPMD crashes or fails to analyse a file.
    on Mar 5, 2020
  2. adangel
    added this to the 6.22.0 milestone on Mar 5, 2020
  3. adangel
    self-assigned this
    on Mar 6, 2020
  4. adangel
    added a commit that references this issue on Mar 6, 2020

    [core] Call SymbolFacade without classloader by default

    This issue will close once commit 4468db2 is merged into the 'main' branch.
    4468db2
  5. adangel
    added
    has:pr
    on Mar 6, 2020
  6. adangel
    closed this as completedin 4468db2on Mar 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @adangel
    adangel

Labels

a:bugPMD crashes or fails to analyse a file.

Type

No type

Projects

No projects

    Milestone

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