[JBoss-user] [Javassist user questions] - Re: inserting duplicated members

2004-05-31 Thread fluca1978
I've tested javassist 3 (beta), recompiling my sources with the above library, but the behavior of the shown code has not changed. I've substituted the aPool.write() call with a call toBytecode() over the CtClass object, but I'm still able to copy duplicated members as detailed in previous

[JBoss-user] [Javassist user questions] - Re: inserting duplicated members

2004-05-24 Thread fluca1978
Well, I suppose it suffices the field_info is different, since even adding fields of the same type works. I've tried it both with a primitice type (an int) and an object (a string), both with the same name and the same access specifier (even if this should not change things) and it works. Luca

[JBoss-user] [Javassist user questions] - Re: inserting duplicated members

2004-05-20 Thread fluca1978
Well, src and dest are different CtClass, I mean they are produced from different classes. When I try to define the class, in my classloader, as: /* create the pools */ ClassPool aPool=ClassPool.getDefault(); this.addClasspathToPoll(aPool); . byte[]

[JBoss-user] [Javassist user questions] - Re: inserting duplicated members

2004-05-18 Thread fluca1978
Maybe I'm misunderstanding but I've the following code to work on my system: CtField fields[]=src.getDeclaredFields(); CtField addingField=null; for(int i=0;ifields.length;i++) { addingField=new CtField(fields.getType(),fields.getName(),dest);

[JBoss-user] [Javassist user questions] - inserting duplicated members

2004-05-15 Thread fluca1978
Hi, is it possible, using Javassist, to insert in an exisiting class duplicated members? I mean, supposing a class has a variable and a method like the following: public int variable; public void method(){..} can I insert a CtField which represents a variable with variable name and is an int,