You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It depends on the definitions of A and B, but generally there is no way for the parser to know that it is getting bytes that are meant for a different message types. In some cases, it can detect that a message does not make sense and then it would throw an exception. The validate function is returning a Try that fails when those cases happen.
println(B.parseFrom(A("hello", 100).toByteArray)) // B(0, "")
println(A.parseFrom(B(100, "hello").toByteArray)) // A("", 0)
Is this intended? Then why do we have a "validate" method? Is there a sbt setting to change these defaults and make it throw exception?
The text was updated successfully, but these errors were encountered: