Skip to content

Text renderer: materialize CharSequence values as String #130 - #131

Merged
stariy95 merged 1 commit into
dflib:mainfrom
paulk-asert:text-renderer-charsequence
Aug 28, 2026
Merged

Text renderer: materialize CharSequence values as String #130#131
stariy95 merged 1 commit into
dflib:mainfrom
paulk-asert:text-renderer-charsequence

Conversation

@paulk-asert

Copy link
Copy Markdown
Contributor

Fixes #130.

Text.renderCharSequence stored the raw CharSequence object in the DisplayData bundle. The value is later serialized by Gson, which handles String (and, by virtue of built-in adapters, StringBuilder/StringBuffer) but turns other implementations into a reflective field dump — or fails outright with JsonIOException on JDK-internal types such as CharBuffer under strong encapsulation.

The fix materializes the value once via String.valueOf(data) and serves that for every requested mime type.

New TextTest covers: plain String, StringBuilder, CharBuffer (the JsonIOException case), a custom CharSequence (stand-in for library types like commons-text TextStringBuilder or Groovy's GString, which is how this surfaced), and an alternate requested mime type. jjava-jupyter module: 151 tests green.

@stariy95
stariy95 merged commit 4a103f5 into dflib:main Aug 28, 2026
5 checks passed
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.

Text renderer stores the raw CharSequence in the mime bundle — non-String implementations render as object internals or fail with JsonIOException

2 participants