0 Replies Latest reply on Dec 28, 2017 2:29 PM by Gabriel Wrzosek

    Javassist replacing incorrect expression

    Gabriel Wrzosek Newbie

      Hi,

      At the beginning I would like to say that I'm just starting with Javassist, so please be understanding.

      I know that Javassist allows to replace methods and constructors, but i would like to know if it's possible to solve the following problem:

       

      After reading the input file, all semantic incorrect expression like:

       

      SwitchCase(variable, 1, 3, 5);

       

      rechange to the correct construction:

       

      switch (variable)

      {

      case 1:

      break;

      case 3:

      break;

      case 5:

      break;

      default:

      throw new ArgumentOutOfRangeException("variable");

      }

       

      Javassist allows to rechange incorrect expression to correct form?

       

      Thank you for your answer!

      Gabriel