Skip to content

FIX(pmd): @W-18808343@: Prevent AppExchange rules from running in an infinite loop #312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 20, 2025

Conversation

stephen-carter-at-sf
Copy link
Collaborator

@@ -25,17 +25,11 @@ public class DangerousChangeProtectionMethods extends AbstractApexRule {

@Override
public Object visit(ASTMethodCallExpression node, Object data) {
if (Helper.isTestMethodOrClass(node)) {
super.visit(node, data);
Copy link
Collaborator Author

@stephen-carter-at-sf stephen-carter-at-sf Jun 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue was because we super.visit was called twice (once here and once below). Ravindra should have returned the super.visit output here instead of continuing.

It caused an issue with this one file because this one file has a name that is referenced within itself. Since super was called twice it wasn't able to use its recursion detection I believe.

@stephen-carter-at-sf stephen-carter-at-sf merged commit f8b444b into dev Jun 20, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG][code-analyzer] The AppExchange:AvoidChangeProtectionUnprotected freezes execution
2 participants