isapego commented on code in PR #10214:
URL: https://github.com/apache/ignite/pull/10214#discussion_r953780965
##########
modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/SerializableSerializer.cs:
##########
@@ -603,13 +597,33 @@ private static object ReadAsCustomType(Type customType,
SerializationInfo serInf
{
var ctorFunc =
SerializableTypeDescriptor.Get(customType).SerializationCtor;
- var customObj = ctorFunc(serInfo, ctx);
+ var customObj = ctorFunc != null
+ ? ctorFunc(serInfo, ctx)
+ : FormatterServices.GetUninitializedObject(customType);
var wrapper = customObj as IObjectReference;
- return wrapper == null
+ var resObj = wrapper == null
? customObj
: wrapper.GetRealObject(ctx);
+
+ // Special case: type is replaced, but there is no serialization
ctor.
+ // Example: StringComparer.OrdinalIgnoreCase.
+ if (ctorFunc == null)
+ {
+ // Cached internally.
+ var members =
FormatterServices.GetSerializableMembers(resObj.GetType());
Review Comment:
What about non-serializable members? What if non-serializable method greatly
affects object functionality?
--
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]