Skip to content

Fix infinite loop in getisArtifact method - #756

Merged
MaximPlusov merged 1 commit into
integrationfrom
tree-loop
Sep 15, 2026
Merged

MaximPlusov merged 1 commit into
integrationfrom
tree-loop

Conversation

@LonelyMidoriya

@LonelyMidoriya LonelyMidoriya commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Prevented infinite loops when processing cyclic parent chains in structure elements.
    • Improved stability when evaluating whether annotations are artifacts in documents with circular structure relationships.

@coderabbitai

coderabbitai Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: de4a7796-80cc-4a2f-9611-8a8541289541

📥 Commits

Reviewing files that changed from the base of the PR and between 5d59d2d and d23f682.

📒 Files selected for processing (1)
  • validation-model/src/main/java/org/verapdf/gf/model/impl/pd/GFPDAnnot.java

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

GFPDAnnot.getisArtifact() now prevents repeated traversal of cyclic structure-element parent chains by tracking visited COSKey values. The file also consolidates its java.util imports.

Changes

Artifact parent traversal

Layer / File(s) Summary
Cycle guard in artifact detection
validation-model/src/main/java/org/verapdf/gf/model/impl/pd/GFPDAnnot.java
getisArtifact() stores visited structure-element keys and stops when a key repeats. The file replaces four specific java.util imports with a wildcard import.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to d23f6

The cycle guard addresses the reported infinite traversal, and no reachable uncovered cycle risk was verified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preventing the infinite loop in getisArtifact.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tree-loop

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@MaximPlusov
MaximPlusov merged commit d1a3974 into integration Sep 15, 2026
8 checks passed
@MaximPlusov
MaximPlusov deleted the tree-loop branch September 20, 2026 14:03
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.

2 participants