Skip to content

[Question] [Java]Serializing a ProtobufXXXXClass.Builder object may throw an exception #3194

@moooonk

Description

@moooonk

Question

Serializing a ProtobufXXXXClass.Builder object may throw an exception:
Exception in thread "fory-jit-compiler-56" java.lang.RuntimeException: java.lang.NoSuchMethodException: no such method: com.google.protobuf.MapEntry.parseFrom(CodedInputStream)MapEntry/invokeStatic

Analysis: Because the Builder class does not match any branch in ProtobufDispatcher, its internal fields are subsequently traversed. MapEntry indeed does not contain a parseFrom method.

Question: Should Fory support serializing the Builder class, or is it sufficient to only support the finalized object returned by Builder.build()?
@chaokunyang

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions