2 Replies Latest reply on Feb 24, 2005 10:05 AM by sins ro

    Constructor modification?

    sins ro Newbie

      I am modifying an existing constructor

      CtConstructor constructor=cc.getConstructors()[0];
      constructor.setBody("System.out.println(\"hello1\"); System.out.println(\"hello2\"); ");

      But for some reason, only the first statement is added (I double checked by decompiling the class), and when running only Hello1 is printed.

      Anyone know what the problem might be, and how to fix this?