Exclude exit nodes from Java PrintCFG query for deterministic test ou…#23
Merged
data-douser merged 1 commit intomainfrom Feb 7, 2026
Merged
Exclude exit nodes from Java PrintCFG query for deterministic test ou…#23data-douser merged 1 commit intomainfrom
data-douser merged 1 commit intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request updates the Java PrintCFG CodeQL tool query to make its output deterministic across CodeQL CLI versions by excluding exit-related CFG nodes (whose relative ordering can vary), and aligns the corresponding golden test output with the new behavior.
Changes:
- Add an
isExitNodepredicate to identify and filter out exit-related CFG nodes. - Update the
nodesandedgesquery predicates to exclude exit nodes from graph output. - Update
PrintCFG.expectedforExample1.javato remove “Normal Exit”, “Exceptional Exit”, and “Exit” node expectations.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| server/ql/java/tools/src/PrintCFG/PrintCFG.ql | Excludes exit-related CFG nodes/edges to stabilize graph output ordering across CLI versions. |
| server/ql/java/tools/test/PrintCFG/PrintCFG.expected | Updates expected graph output to match the new filtered CFG output. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates the
PrintCFGtool to produce deterministic output by excluding exit-related control flow graph (CFG) nodes, whose ordering was previously non-deterministic across CodeQL CLI versions. The test expectations have been updated accordingly to match the new output.Outline of Changes
Deterministic Output Improvements:
isExitNodepredicate inPrintCFG.qlto identify exit-related CFG nodes, and updated thenodesandedgesquery predicates to exclude these nodes from the output. This ensures consistent output regardless of CodeQL CLI version.Test Updates:
PrintCFG.expectedtest file forExample1.javato remove all lines referencing "Normal Exit", "Exceptional Exit", and "Exit" nodes, aligning the test expectations with the new deterministic output. [1] [2] [3] [4] [5]