Git Product home page Git Product logo

Comments (5)

thesamet avatar thesamet commented on June 15, 2024 1

Unrecognized enums override scalaValueDescriptor to give a descriptor that represents the unknown value, see here

from scalapb.

thesamet avatar thesamet commented on June 15, 2024

Assuming the message also contains Status status = 7 above.

Confirming the behavior you are seeing. There isn't a straightforward fix because as far as I can tell there's no public method in the Java protobuf API to instantiate an EnumValueDescriptor that represents an unknown enum. Is it possible for your code to use getField instead of getFieldByNumber at least for enums?

from scalapb.

honzastrnads1 avatar honzastrnads1 commented on June 15, 2024

Assuming the message also contains Status status = 7 above.

Yes, sorry for that.

Confirming the behavior you are seeing. There isn't a straightforward fix because as far as I can tell there's no public method in the Java protobuf API to instantiate an EnumValueDescriptor that represents an unknown enum. Is it possible for your code to use getField instead of getFieldByNumber at least for enums?

No, it's not easily possible to substitute and I don't think it would help either. We would race into the same issue, just on a different place, specifically here.

from scalapb.

thesamet avatar thesamet commented on June 15, 2024

Since the original issue (on getFieldByNumber) doesn't have a reasonable fix there isn't much that can be done to address it (I consider deprecating the method in a future release as it predates the PValue API used by getField). I wanted to check in if getField provides a reasonable alternative or you have any other suggestion.

from scalapb.

honzastrnads1 avatar honzastrnads1 commented on June 15, 2024

Unfortunately migrating to getField would require quite a few changes on our side, so it's a no go for us at the moment.

from scalapb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.