[apex] Fix parsing of triggers with declarations

Only the grandchildren of a trigger block were ending up in the tree,
but the direct children of triggerBlock were missing, e.g.
ForLoopStatement. This caused OperationWithHighCostInLoop to not
find the loop anymore in triggers.

This will probably fix other false negatives in triggers in
other rules as well.

Fixes #5139
This commit is contained in:
Andreas Dangel
2024-07-27 20:15:23 +02:00
parent d2fbe14afa
commit 3735fd145b
8 changed files with 109 additions and 6 deletions

View File

@@ -15,6 +15,8 @@ This is a {{ site.pmd.release_type }} release.
### 🚀 New and noteworthy
### 🐛 Fixed Issues
* apex-performance
* [#5139](https://github.com/pmd/pmd/issues/5139): \[apex] OperationWithHighCostInLoop not firing in triggers
* plsql-bestpractices
* [#5132](https://github.com/pmd/pmd/issues/5132): \[plsql] TomKytesDespair - exception for more complex exception handler