You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fesod.apache.org by "leehaut (via GitHub)" <gi...@apache.org> on 2026/09/01 06:09:43 UTC
[PR] refactor: add ReadCache no-op defaults and unit tests [fesod]
leehaut opened a new pull request, #1063:
URL: https://github.com/apache/fesod/pull/1063
## Purpose of the pull request
Give `ReadCache` no-op `default` methods so implementations that do not need lifecycle hooks (or `put`) no longer have to ship empty method bodies, and add unit coverage for the interface and all built-in implementations.
## What's changed?
`get(Integer)` stays abstract. The other methods default to no-ops:
| Method | Default | Still overridden by |
|---|---|---|
| `init` | no-op | `Ehcache` |
| `put` | no-op | `MapCache`, `Ehcache` |
| `get` | required | all implementations |
| `putFinished` | no-op | `Ehcache` |
| `destroy` | no-op | `Ehcache` |
Call sites are unchanged: xlsx still calls `init` / `put` / `putFinished` / `destroy`; xls `XlsCache` only needs `get` because the SST record is already populated.
Subclass surface after this change:
- `XlsCache` — `get` only
- `MapCache` — `put` + `get`
- `Ehcache` — unchanged; it still implements the full contract
Binary compatible for existing custom `ReadCache` implementations. Empty overrides can be removed, but they still compile if left in place.
Added `@Tag(unit)` tests:
- `ReadCacheTest` — a get-only implementation can rely on the default no-ops
- `MapCacheTest` — insertion order, `null`/empty values, negative keys, out-of-range `get`
- `XlsCacheTest` — SST index lookup, Unicode content, defaults do not mutate SST
- `EhcacheTest` — remainder flush, batch boundary, cross-batch cache miss, deprecated constructor, isolated instances; `destroy()` in `@AfterEach`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org
Re: [PR] refactor: add ReadCache no-op defaults and unit tests [fesod]
Posted by "delei (via GitHub)" <gi...@apache.org>.
delei merged PR #1063:
URL: https://github.com/apache/fesod/pull/1063
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org