1 Reply Latest reply on Oct 28, 2005 11:19 AM by Shigeru Chiba

    CtConstructor insertBefore problem

    Jake Phillips Newbie

      If I call insertBefore on a CtConstructor object it inserts the code after the implicit super() call which is desired, but before the initialization is done (which may also be inlined).

      this causes problems with code like:

      int[] test=new int[] {0,0};

      public FooClass() {

      and calling insertBefore on FooClass with "test[0]=3" will cause a runtime error since it is attempting to assign a value to an array that doesn't exist yet since initialization hasn't been completed.