Skip to content

fix: replace deprecated Option.Builder.build() with get()#241

Open
david-waltermire wants to merge 1 commit intometaschema-framework:developfrom
david-waltermire:fix/replace-deprecated-option-builder
Open

fix: replace deprecated Option.Builder.build() with get()#241
david-waltermire wants to merge 1 commit intometaschema-framework:developfrom
david-waltermire:fix/replace-deprecated-option-builder

Conversation

@david-waltermire
Copy link
Contributor

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

Summary

  • Replace deprecated Option.Builder.build() calls with get() in AbstractResolveCommand and ListAllowedValuesCommand. The build() method was deprecated in Apache Commons CLI 1.9 in favor of get() (the Builder now implements Supplier<Option>).

Test plan

  • Build succeeds with no deprecation warnings

Summary by CodeRabbit

  • Refactor
    • Updated internal option initialization methods in command processing modules to standardize builder chain retrieval patterns. Enhanced code consistency and maintainability by implementing uniform approaches across multiple command classes. These architectural improvements strengthen internal code quality without affecting the public API, user-facing functionality, or command behavior.

Replace deprecated Apache Commons CLI Option.Builder.build() calls
with get(), which is the replacement API since Commons CLI 1.9.
@coderabbitai
Copy link

coderabbitai bot commented Feb 13, 2026

📝 Walkthrough

Walkthrough

This pull request replaces the .build() method with .get() when finalizing Option builder instances in two CLI command classes, changing how Option objects are retrieved from their builder chains without altering functionality or public APIs.

Changes

Cohort / File(s) Summary
Option builder method replacement
src/main/java/dev/metaschema/oscal/tools/cli/core/commands/AbstractResolveCommand.java, src/main/java/dev/metaschema/oscal/tools/cli/core/commands/ListAllowedValuesCommand.java
Changed Option builder finalization from .build() to .get() for RELATIVE_TO, PRETTY_PRINT_OPTION, and CONSTRAINTS_OPTION, updating how builder results are obtained.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested reviewers

  • aj-stein-gsa

Poem

🐰 A builder hop, skip, and jump,
From .build() to .get() we bump,
Options now retrieved with grace,
No logic changed, just a cleaner place!

🚥 Pre-merge checks | ✅ 3 | ❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 specifically summarizes the main change: replacing deprecated Option.Builder.build() with get() across multiple command files.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into develop

✏️ 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

No actionable comments were generated in the recent review. 🎉

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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