Skip to content

[apex] Apex classes with safe navigation operator from Winter 21 (50.0) are skipped #2839

@avesolovksyy

Description

@avesolovksyy

Affects PMD Version: 6.27

Description:

Since new salesforce release (Winter 21, api version 50) has gone GA over weekend, we've started using new features in our Apex codebase, in particular safe navigation operator (e.g. myObject?.propA?.propB). But unfortunately it looks like pmd just skips all apex classes where safe navigation operator is used - it seems like pmd cannot yet parse this new apex syntax and just silently fails, which results in skipping such troubling apex classes.

Exception Stacktrace:
No error, no stack trace - classes are just skipped from scanning, i.e. no errors are reported from those classes, even when we add deliberately some errors there. But when we remove safe navigation operator from class, it starts reporting errors as before.

Salesforce Release Notes: https://releasenotes.docs.salesforce.com/en-us/winter21/release-notes/rn_apex.htm

Metadata

Metadata

Assignees

Labels

a:bugPMD crashes or fails to analyse a file.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions