Skip to content

refactor(decode): drop unused accepts(DType) from EncodingDecoder SPI#142

Merged
dfa1 merged 1 commit into
mainfrom
refactor/drop-decoder-accepts
Jun 23, 2026
Merged

refactor(decode): drop unused accepts(DType) from EncodingDecoder SPI#142
dfa1 merged 1 commit into
mainfrom
refactor/drop-decoder-accepts

Conversation

@dfa1

@dfa1 dfa1 commented Jun 23, 2026

Copy link
Copy Markdown
Owner

What

EncodingDecoder.accepts(DType) is a residual of the ADR-0001 read/write runtime split. The pre-split unified Encoding interface combined encode + accepts + decode; the split copied the full method set onto both EncodingDecoder and EncodingEncoder.

accepts is encode-selection semantics — its javadoc literally said "can this encoding encode the dtype". The writer still uses it (CascadingCompressor, StructEncodingEncoder, …), but the reader dispatches decoders purely by EncodingId (ReadRegistry's Map<EncodingId, EncodingDecoder>) and never calls accepts. It has been dead on the read side since the split — which is why SonarCloud flagged it uncovered on BitpackedEncodingDecoder.

This is the dead-code (not missing-test) branch of the triage just documented in docs/testing.md: delete the clause, don't write a test for it.

Changes

  • Remove accepts from the EncodingDecoder interface and all 33 implementations.
  • Remove the decoder-side accepts assertions from unit tests. The writer EncodingEncoder.accepts assertions stay (that method is live).
  • Add DictEncodingDecoderTest#encodingId_isVortexDict so that outer class keeps a non-nested instance test (removing its only one tripped checkstyle's utility-class rule) — genuine coverage, matches siblings.

EncodingEncoder.accepts is unchanged.

Net: 42 files, −265/+3.

Note on the SPI

EncodingDecoder is a public SPI. Dropping a method is technically a source-breaking change for any downstream custom decoder, but the method was never invoked by the read path — implementers were forced to write a body that nothing called.

Verification

  • Full unit suite, all modules — green
  • reader/writer build — clean (javac -Werror, Checkstyle, Javadoc)

🤖 Generated with Claude Code

accepts(DType) was a residual of the ADR-0001 read/write runtime split: the
pre-split unified Encoding interface combined encode + accepts + decode, and
the split copied the full method set onto both EncodingDecoder and
EncodingEncoder. accepts is encode-selection semantics ("can this encoding
*encode* the dtype") — the writer's CascadingCompressor and friends still use
EncodingEncoder.accepts, but the reader dispatches decoders purely by
EncodingId (ReadRegistry's Map<EncodingId, EncodingDecoder>) and never calls
it. The method has been dead on the read side since the split; SonarCloud
flagged it as uncovered on BitpackedEncodingDecoder.

Remove accepts from the EncodingDecoder interface and all 33 implementations,
plus the decoder-side accepts assertions in the unit tests (the writer
encoder.accepts assertions stay). Added a DictEncodingDecoderTest#encodingId
test to keep that outer class from collapsing to a checkstyle utility class
once its only non-nested test was removed.

EncodingEncoder.accepts is unchanged.

Verified: full unit suite (all modules) green; reader/writer build clean
(javac -Werror, checkstyle, javadoc).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dfa1 dfa1 merged commit 7516a54 into main Jun 23, 2026
6 checks passed
@dfa1 dfa1 deleted the refactor/drop-decoder-accepts branch June 23, 2026 06:39
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