vadimkolodingg commented on code in PR #6931:
URL: https://github.com/apache/ignite-3/pull/6931#discussion_r2559845735
##########
modules/marshaller-common/src/main/java/org/apache/ignite/internal/marshaller/Marshaller.java:
##########
@@ -283,13 +284,14 @@ private static class PojoMarshaller extends Marshaller {
/** {@inheritDoc} */
@Override
public Object readObject(MarshallerReader reader, Object target)
throws MarshallerException {
- Object obj = target == null ? factory.create() : target;
-
- for (int fldIdx = 0; fldIdx < fieldAccessors.length; fldIdx++) {
- fieldAccessors[fldIdx].read(reader, obj);
+ if (target != null) {
+ for (int fldIdx = 0; fldIdx < fieldAccessors.length; fldIdx++)
{
+ fieldAccessors[fldIdx].read(reader, target);
+ }
+ return target;
Review Comment:
It's not a copy, it's slightly refactored original code just because of
`target` argument. Moreover, it seems that `target` argument always null -
every method usage pass null. I'd rather remove that argument, but I don't know
what it can break.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]