-
1. Re: How to write new operator in function body ?
chiba Oct 15, 2004 10:14 PM (in response to skyman)It seems a bug. I'll examine...
By the way, is "Type" in your code defined
or undefined? -
2. Re: How to write new operator in function body ?
chiba Oct 16, 2004 1:08 PM (in response to skyman)I tested it but I could not cause the problem.
Can you tell me details of "Type" type in your
example? Is it a really top-level type? Is there
Type.class? etc... -
3. original code of a problem
skyman Oct 17, 2004 5:37 AM (in response to skyman)Here is a original code of a problem,
I think problem is in the new operator.
CtMethod add = CtNewMethod
.make(
"public net.jini.core.event.EventRegistration addMonitoringRemoteEventListener(net.jini.core.event.RemoteEventListener listener) throws java.rmi.RemoteException { $0.listenerList.addElement(listener); return new net.jini.core.event.EventRegistration(0L, this, null, 0L); }",
clas);
clas.addMethod(add);
add.setModifiers(Modifier.PUBLIC);
The error is :
javassist.CannotCompileException: [source error] fatal
[source error] fatal
at javassist.CtNewMethod.make(CtNewMethod.java:78)
at javassist.CtNewMethod.make(CtNewMethod.java:44) -
4. Re: How to write new operator in function body ?
chiba Oct 17, 2004 12:18 PM (in response to skyman)Hmm... still no progress.
(I haven't run your code with the jini package, though.)
Could you show me the detailed stack trace,
in particular, the lines below "Caused by:"
(you only showed the first four lines)?
Thank you for your help! -
5. Re: How to write new operator in function body ?
chiba Oct 17, 2004 12:20 PM (in response to skyman)Or, a stand-alone test case is welcome! :-)
Thanks. -
6. Re: How to write new operator in function body ?
skyman Oct 18, 2004 10:09 AM (in response to skyman)Hi
I have been putted all files of my work in here.
http://debian.fmi.uni-sofia.bg/~filetrans/chiba/
To run write in comman line :
java -cp javassist.jar;jini-core.jar;. JassistServiceMonitoring HelloWorldServiceProxy
I hope that now the problem is clearly.
Thanks -
7. Re: How to write new operator in function body ?
chiba Oct 21, 2004 5:51 AM (in response to skyman)Thank you!
I ran your test case with javassist.jar 3.0RC1 and got a better message.javassist.CannotCompileException: [source error] Field listenerList in skyman.jini.observer.common.MonitoringAbleInterface is private.
Does this make sense?
Chiba