forcedotcom / sfdx-scanner

MIT License
209 stars 49 forks source link

Null Coalescing Operator (??) causing issues on Code Analyzer #1389

Closed HerbertHBT closed 4 months ago

HerbertHBT commented 4 months ago

Hi Everyone,

I've started using the new null coalescing operator "??" made available in release Sping '24. Doc reference: https://help.salesforce.com/s/articleView?id=release-notes.rn_apex_NullCoalescingOper.htm&release=248&type=5

The code works perfectly in sandboxes and prod, but I'm facing issues with the code analyzer scanner when the code contains the ?? operator. It throws the following error:

PMDException: Error while parsing .cls Caused by: net.sourceforge.pmd.lang.ast.ParseException: apex.jorje.services.exception.ParseException: Syntax(error = UnexpectedToken(loc = (144, 61, 1071, 1072), token = '?'))

Thanks

jag-j commented 4 months ago

This is a duplicate of #1293. We are fixing this with one of our upcoming releases. Thanks for reporting!