You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/08/24 13:09:45 UTC

[GitHub] [ignite] isapego commented on a diff in pull request #10214: IGNITE-17299 .NET: Fix StringComparer serialization

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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org