Coder Social home page Coder Social logo

Comments (10)

chibash avatar chibash commented on July 19, 2024 2

The specification is that Javassist's compiler only supports Java 1.4 (yes, old!) syntax.
But, I'll check the code and, if it's easy to implement, I'll support string constants as a label.

from javassist.

chibash avatar chibash commented on July 19, 2024 1

I've done. See Test/switch case #231.

from javassist.

SergiusSidorov avatar SergiusSidorov commented on July 19, 2024

Thanks!

from javassist.

QIvan avatar QIvan commented on July 19, 2024

@chibash
Hi! I need this feature too. Did you check code? Is it hard to implement?

from javassist.

smilanko avatar smilanko commented on July 19, 2024

any progress on this? While I do not mind using the if cases, a switch would really be nice ;)

from javassist.

lygoing avatar lygoing commented on July 19, 2024

@chibash
Hi!
I also encountered the same situation! May I ask how to solve this problem now? thank you very much

from javassist.

smilanko avatar smilanko commented on July 19, 2024

@lygoing I doubt that a solution has been made, in the version we are referencing. I ended up just using if statements to solve the issue. More code, but oh well, it works. Does doing the same not solve the problem for you?

from javassist.

lygoing avatar lygoing commented on July 19, 2024

@smilanko
Hi!
The case is more efficient than if, and I am now solving this with the string hashcode.
like this:
switch (fieldName.hashCode()) {
case -861253476:
return context.getField13();
case -861253471:
return context.getField18();
}

from javassist.

andreysubbotin avatar andreysubbotin commented on July 19, 2024

Hi,
Do you have any plans to fix the problem?

from javassist.

chibash avatar chibash commented on July 19, 2024

I'm working... Check the test/switch-case branch.

from javassist.

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.