1 Reply Latest reply on Jul 19, 2005 9:26 PM by Shigeru Chiba

    how to avoid adding field to InnerClasses

    Shi Xing Huang Newbie

      Original Code:
      class ClassA{
      class ClassB{}{
      }
      }
      ------------------------------------------
      Javaassist code :
      CtClass cc = pool.makeClass("ClassA");
      CtField cf = CtField.make("public static String value;", cc);
      cc.addField(cf);
      ------------------------------------------
      when executed, the ClassA.class as following:
      class ClassA{
      public static String value;
      class ClassB{}{
      public static String value;
      }
      }

      --------------------------------------------
      so my question is how to avoid adding the "value" field to ClassB. my execpted result is :
      class ClassA{
      public static String value;
      class ClassB{}{
      }
      }