Skip to content

refactor: remove AllowedValueCollectingNodeItemVisitor#256

Open
david-waltermire wants to merge 1 commit intometaschema-framework:mainfrom
david-waltermire:feature/remove-allowed-values-visitor
Open

refactor: remove AllowedValueCollectingNodeItemVisitor#256
david-waltermire wants to merge 1 commit intometaschema-framework:mainfrom
david-waltermire:feature/remove-allowed-values-visitor

Conversation

@david-waltermire
Copy link
Contributor

@david-waltermire david-waltermire commented Feb 18, 2026

Summary

  • Removes AllowedValueCollectingNodeItemVisitor which has been migrated to the metaschema-java core module (dev.metaschema.core.metapath.item.node)
  • Removes associated test classes (AllowedValueCollectingNodeItemVisitorTest, AbstractNodeItemVisitorTest)
  • Removes issue-112 test resources that were only used by the visitor tests

Context

The visitor is a generic Metaschema utility with no OSCAL-specific logic. Moving it to metaschema-java makes it available to all Metaschema-based projects without requiring a dependency on liboscal-java.

Depends on: metaschema-framework/metaschema-java#666

Test plan

  • Full CI build passes (mvn clean install -PCI -Prelease)
  • No remaining references to deleted files
  • No other code in liboscal-java depends on the removed visitor

Summary by CodeRabbit

Release Notes

  • Refactor

    • Removed internal utility classes and supporting infrastructure previously used for collecting and managing allowed value constraints.
  • Tests

    • Removed associated test files, test classes, and test resources that were used to validate the removed utilities.

This visitor has been migrated to the metaschema-java core module
at dev.metaschema.core.metapath.item.node, making it available to
all Metaschema-based projects without requiring a dependency on
liboscal-java.

Removes:
- AllowedValueCollectingNodeItemVisitor and its tests
- AbstractNodeItemVisitorTest (only tested the visitor)
- issue-112 test resources (only used by visitor tests)
@coderabbitai
Copy link

coderabbitai bot commented Feb 18, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

The pull request removes the AllowedValueCollectingNodeItemVisitor class along with its nested NodeItemRecord and AllowedValuesRecord classes, eliminating the visitor implementation for collecting allowed values from node items and all associated test files and test resources.

Changes

Cohort / File(s) Summary
Production Code Removal
src/main/java/dev/metaschema/oscal/lib/model/util/AllowedValueCollectingNodeItemVisitor.java
Deleted the entire AllowedValueCollectingNodeItemVisitor class with nested record classes and visitor traversal methods (183 lines).
Test Files Removal
src/test/java/dev/metaschema/oscal/lib/model/util/AbstractNodeItemVisitorTest.java, src/test/java/dev/metaschema/oscal/lib/model/util/AllowedValueCollectingNodeItemVisitorTest.java
Deleted two test classes: one with disabled test methods and one with two test methods verifying allowed values collection behavior (93 + 78 lines).
Test Resources Removal
src/test/resources/content/issue-112/computer-example.xml, src/test/resources/content/issue-112/computer-metaschema-meta-constraints.xml
Deleted test resource files containing minimal computer model metaschema and constraint definitions used by the removed tests (14 + 15 lines).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • aj-stein

Poem

🐰 A visitor once collected values with care,
Through node items, gathering constraints fair,
But now it hops away into the past,
Along with its tests, no longer to last,
The code has moved on to simpler fare! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 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 summarizes the main change: removing the AllowedValueCollectingNodeItemVisitor class, which is the primary purpose of this refactoring PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

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.

1 participant

Comments