Unable to deserialize lambda

前端 未结 2 495
陌清茗
陌清茗 2020-11-30 14:11

Just as a small project, I\'ve been trying to make a wee thing that reads serialized lambdas (locally or from an FTP) and invokes their run functions as part of a test to ex

2条回答
  •  鱼传尺愫
    2020-11-30 14:47

    When you deserialize an object, the code doing the deserialization must know about the class of the serialized object. You cannot serialize an arbitrary lambda and deserialize it in another codebase.

    More or less, the serializing and deserializing code must be in the same codebase, or at least must share a dependency on the code containing the original lambda.

提交回复
热议问题