Skip to content

CFG: Rename ForeachStmt to ForEachStmt. - #22489

Merged
aschackmull merged 1 commit into
github:mainfrom
aschackmull:cfg/rename-foreach
Sep 2, 2026
Merged

CFG: Rename ForeachStmt to ForEachStmt.#22489
aschackmull merged 1 commit into
github:mainfrom
aschackmull:cfg/rename-foreach

Conversation

@aschackmull

Copy link
Copy Markdown
Contributor

This renames all the instances that are effectively private (everything except C#).

Copilot AI balanced review requested due to automatic review settings September 2, 2026 08:55
@aschackmull
aschackmull requested review from a team as code owners September 2, 2026 08:55
@aschackmull aschackmull added the no-change-note-required This PR does not need a change note label Sep 2, 2026
@aschackmull
aschackmull requested review from a team as code owners September 2, 2026 08:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The mechanical rename is complete across the shared signature and all implementations, with no stale non-C# references found.

Review tier: Balanced
Findings: None

What changed in this PR

Renames the private CFG abstraction from ForeachStmt to ForEachStmt while preserving C#’s public ForeachStmt API.

Changes:

  • Renames the shared CFG signature and internal references.
  • Updates all language-specific implementations.
File Description
shared/​controlflow/​codeql/​controlflow/​ControlFlowGraph.qll Renames the shared class and usages.
unified/​ql/​lib/​codeql/​unified/​internal/​ControlFlowGraph.qll Updates the Unified implementation.
ruby/​ql/​lib/​codeql/​ruby/​controlflow/​ControlFlowGraph.qll Updates the Ruby stub implementation.
python/​ql/​lib/​semmle/​python/​controlflow/​internal/​AstNodeImpl.qll Updates Python implementation and cast.
java/​ql/​lib/​semmle/​code/​java/​ControlFlowGraph.qll Updates the Java implementation.
csharp/​ql/​lib/​semmle/​code/​csharp/​controlflow/​internal/​ControlFlowGraph.qll Updates the private adapter while preserving the public C# name.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

final private class FinalForeachStmt = CS::ForeachStmt;

class ForeachStmt extends FinalForeachStmt {
class ForEachStmt extends FinalForeachStmt {
@@ -190,7 +190,7 @@ module Ast implements AstSig<Location> {

final private class FinalForeachStmt = CS::ForeachStmt;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Worth renaming FinalForeachStmt and similar at the same time?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll do C# in a follow-up.

@aschackmull
aschackmull merged commit 738c91f into github:main Sep 2, 2026
120 checks passed
@aschackmull
aschackmull deleted the cfg/rename-foreach branch September 2, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants