Menu

#1118 ClassCastException in pmd.lang.ecmascript.ast.ASTElementGet

PMD-5.0.5
closed
None
PMD
3-Major
Bug
5.0.4 and 5.0.3
2013-08-04
2013-07-25
No

Hi,

I use PMD to analyse JavaScript.
If node is an instance of net.sourceforge.pmd.lang.ecmascript.ast.ASTElementGet then:

1) node.getTarget() generates this exception:
java.lang.ClassCastException: org.mozilla.javascript.ast.Name cannot be cast to net.sourceforge.pmd.lang.ecmascript.ast.EcmascriptNode
at net.sourceforge.pmd.lang.ecmascript.ast.ASTElementGet.getTarget(ASTElementGet.java:22)

2) node.getElement() generates this exception:
java.lang.ClassCastException: org.mozilla.javascript.ast.InfixExpression cannot be cast to net.sourceforge.pmd.lang.ecmascript.ast.EcmascriptNode
at net.sourceforge.pmd.lang.ecmascript.ast.ASTElementGet.getElement(ASTElementGet.java:26)

Tested with PMD 5.0.3 (but source code in PMD 5.0.4 is the same ;-)

Regards.

Related

Issues: #1136

Discussion

  • Andreas Dangel

    Andreas Dangel - 2013-08-03
    • status: open --> in-progress
    • assigned_to: Andreas Dangel
    • Milestone: New Tickets --> PMD-5.0.5
     
  • Andreas Dangel

    Andreas Dangel - 2013-08-04
    • status: in-progress --> closed
     

Log in to post a comment.