Skip to content

fix(base-foundation, base-io): add toString() to Exceptional and PathSet - #103

Merged
deer merged 1 commit into
mainfrom
toString_impls
Aug 14, 2026
Merged

fix(base-foundation, base-io): add toString() to Exceptional and PathSet#103
deer merged 1 commit into
mainfrom
toString_impls

Conversation

@deer

@deer deer commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Exceptional had no toString() override, so instances printed the default Object identity hash instead of anything useful for debugging or logging; this adds a toString() that renders Exceptional[value], Exceptional[exception], or Exceptional.empty depending on which of the three states the instance is in, matching the same three-way branching already used by equals() and hashCode().

PathSet's empty singleton previously rendered as the string "PathSet.empty()", which reads like a factory-method reference rather than a value representation and doesn't match how a populated PathSet prints. This adds a toString() to the internal non-empty PathSetBuilder implementation that delegates to the underlying LinkedHashSet<Path>, and changes PathSet.empty()'s toString() from "PathSet.empty()" to "[]" so both the empty and non-empty cases render consistently with each other and with standard Set formatting.

@deer
deer requested a review from brianoliver August 14, 2026 03:05
@deer
deer merged commit d77967e into main Aug 14, 2026
3 checks passed
@deer
deer deleted the toString_impls branch August 14, 2026 08:01
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