You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "nizhikov (via GitHub)" <gi...@apache.org> on 2026/10/05 12:16:46 UTC
[PR] [MINOR] Remove single usage of CacheObjectValueContext#classLoader [ignite]
nizhikov opened a new pull request, #13647:
URL: https://github.com/apache/ignite/pull/13647
…cause of same value with BinaryContext#classLoader
Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
### The Contribution Checklist
- [ ] There is a single JIRA ticket related to the pull request.
- [ ] The web-link to the pull request is attached to the JIRA ticket.
- [ ] The JIRA ticket has the _Patch Available_ state.
- [ ] The pull request body describes changes that have been made.
The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
- [ ] The pull request title is treated as the final commit message.
The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue.
- [ ] A reviewer has been mentioned through the JIRA comments
(see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers))
- [ ] The pull request has been checked by the Teamcity Bot and
the `green visa` attached to the JIRA ticket (see tab `PR Check` at [TC.Bot - Instance 1](https://tcbot2.sbt-ignite-dev.ru/prs.html) or [TC.Bot - Instance 2](https://mtcga.gridgain.com/prs.html))
### Notes
- [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
- [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
- [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
- [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [MINOR] Remove single usage of CacheObjectValueContext#classLoader [ignite]
Posted by "shishkovilja (via GitHub)" <gi...@apache.org>.
shishkovilja commented on PR #13647:
URL: https://github.com/apache/ignite/pull/13647#issuecomment-5995488299
LGTM
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [MINOR] Remove single usage of CacheObjectValueContext#classLoader [ignite]
Posted by "nizhikov (via GitHub)" <gi...@apache.org>.
nizhikov merged PR #13647:
URL: https://github.com/apache/ignite/pull/13647
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [MINOR] Remove single usage of CacheObjectValueContext#classLoader [ignite]
Posted by "nizhikov (via GitHub)" <gi...@apache.org>.
nizhikov commented on PR #13647:
URL: https://github.com/apache/ignite/pull/13647#issuecomment-5994293942
## Review: removing `CacheObjectValueContext#classLoader()`
**Verdict: correct.** The removed accessor and `BinaryContext#classLoader()` always return the same value, so replacing one with the other in `BinaryObjectImpl.deserializeValue` changes no behaviour.
### Why the values are identical
- `AbstractCacheObjectContext.classLoader()` returned `ctx.config().getClassLoader()`, i.e. the kernal context's `IgniteConfiguration`.
- The node's `BinaryContext` is created in `CacheObjectBinaryProcessorImpl` (line 252) via `U.binaryContext(metaHnd, marsh, ctx.config(), log)`, and that wrapper passes `cfg.getClassLoader()` straight into the `BinaryContext` constructor, which stores it unchanged and returns it from `classLoader()`. Same configuration instance, same getter, same value — including the `null` case.
- No other pairing can occur: `CacheObjectValueContext` has three implementations (`CacheObjectContext`, `AbstractCacheObjectContext`, `CacheQueryObjectValueContext`), all in core and all built on a kernal context. The `BinaryContext` instances created by the thin client, JDBC and platform code are never combined with a `CacheObjectValueContext`. `IgniteMock` in tests also builds its context from `cfg.getClassLoader()`.
### Null path
When no class loader is configured, the old code passed `null` into `reader(rCtx, ldr, forUnmarshal)`, which falls back to `ctx.classLoader()` (also `null`) at `BinaryObjectImpl.java:816`. Downstream resolution is therefore identical before and after.
### `storeValue` relocation
Moving the `storeValue()` check from `deserializeValue(coCtx)` into `value()` is equivalent: `value()` was the only caller with a non-null context, and `deserialize()` passed `null`, so it never stored and still does not.
### Verification
- `ignite-binary-api`, `ignite-binary-impl` compile; `ignite-core` compiles including test sources, so no caller of the removed method remains.
- No file referencing `CacheObjectValueContext` in any module calls `classLoader()` on anything other than a `BinaryContext`; `BinaryObjectOffheapImpl` was already using `ctx.classLoader()` only.
### Nit (readability only)
In `value(CacheObjectValueContext ctx, boolean cpy)` the parameter `ctx` shadows the `BinaryContext` field of the same name, so `ctx.storeValue()` in that method is the parameter while `ctx.classLoader()` in `deserializeValue()` is the field. It compiles to the right thing; renaming the parameter to `coCtx` would make the diff self-evident.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org