-
1. Re: Limitations
chiba Jan 17, 2005 10:28 PM (in response to sirrurg)Hi,
1) The limitation is not applied to copied bytecode.
The tutorial says that the compiler does not understand
synchronized. However, the upcoming release 3.0
supports a synchronized statement. So please download
CVS HEAD or wait for several days. We are going to release
3.0 soon.
2) For example,
class A {}
class B extends A {}
class C extends C {}
class X {
void foo(A a) { .. }
void foo(B b) { .. }
}
If the compiled expression is x.foo(new C()), where x is an instance of X, the compiler may produce a call to foo(A) although the compiler can correctly compile foo((B)new C()).
This description will be also included in the tutorial coming
with the next release. -
2. Re: Limitations
sirrurg Jan 18, 2005 3:39 AM (in response to sirrurg)1) Ok ... in this case i can surely wait, as i m just going to copy methods
and not trying to create new ones.
2) Thx for the example. How is the behaviour if i m performing "wrapping"
like in
"Java programming dynamics, Part 4: Class transformation with
Javassist"
by Dennis M. Sosnoski, IBM developerWorks, September 16, 2003.
So just by copy methods, rename one and add a call like:.... newname($$); ....
Do i also have this "drawbacks" if i m handling it this way?
Sincerely
Sirrurg
P.S.: I hope this question dont become to annoying to you[/url] -
3. Re: Limitations
chiba Jan 19, 2005 8:59 AM (in response to sirrurg)Although $proceed does not imply this problem,
newname($$);
would do. I agree this is a bug, which should be fixed
soon. -
4. Re: Limitations
sirrurg Jan 19, 2005 5:12 PM (in response to sirrurg)So to avoid this problem, i could work around by producing sth like
... newname((Type1)$1, (Type2)$2, ...) ...
Or wouldnt this help anyway?!? -
5. Re: Limitations
chiba Jan 24, 2005 10:30 AM (in response to sirrurg)Yes, that's a perfect solution.
(sorry, it's annonying...)