From 894bb3c70a41ead4a634c2996312f1b98cecda55 Mon Sep 17 00:00:00 2001 From: wisberg Date: Thu, 16 Jun 2005 16:53:16 +0000 Subject: [PATCH] reflective calls, bcel --- docs/faq/faq.xml | 80 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 65 insertions(+), 15 deletions(-) diff --git a/docs/faq/faq.xml b/docs/faq/faq.xml index b571f79fd..85383c8d7 100644 --- a/docs/faq/faq.xml +++ b/docs/faq/faq.xml @@ -22,7 +22,7 @@ 2003-2005 Contributors. All rights reserved. - Last updated April 12, 2005 + Last updated June 16, 2005 For a list of recently-updated FAQ entries, see @@ -3574,22 +3574,50 @@ vmparam -Xmx384m + + Why doesn't AspectJ pick out reflective calls? + The pointcut call(void run()) + won't pick out a call using reflection, like + ((Method)run).invoke(null, args). + + + + The pointcut + execution(void run()) will + work. The call pointcut doesn't work because + Method.invoke(..) is the Java method-call, + and AspectJ cannot delve into the Java reflection library to + implement call semantics. To advise a reflective call + (e.g., because the compiler does not control the code for the + method execution), test the context for invoke(..). + Here's a pointcut that tests only if the method name is + correct: + + +aspect A { + pointcut runReflectiveCall(Method run) : target(run) && + call(Object Method.invoke(..)) && if("run".equals(run.getName())); + before() : runReflectiveCall(Method) { + System.out.println("before reflective call " + thisJoinPoint); + } +} + + + + What are the bugs now most affecting users? - - - The bugs affecting the semantics of the language - are marked with the "info" keyword. Find them with - the query - - http://bugs.eclipse.org/bugs/buglist.cgi?product=AspectJ&keywords=info - - - - + The bugs affecting the semantics of the language + are marked with the "info" keyword. Find them with + the query + + http://bugs.eclipse.org/bugs/buglist.cgi?product=AspectJ&keywords=info + + @@ -4281,7 +4309,27 @@ vmparam -Xmx384m - + + + BCEL is used by AspectJ but it's not actively developed. Will you change? + + + + The AspectJ bytecode weaver has used BCEL for bytecode manipulation + since its first release. We have upgraded it extensively, to improve + performance, support Java 5, etc. The BCEL developers have not + incorporated our patches, so we continue to maintain our own version. + Ours has been optimized for the AspectJ weaver and battle-hardened + over years of development and use. At some point in the future, + the AspectJ weaver might be restructured to make it easy to see + whether another bytecode package offers the same stability, + functionality, and performance, but for now we prefer using something + that we know works well. + + + + Getting Help @@ -4550,9 +4598,11 @@ vmparam -Xmx384m Entries changed recently: - + + + - + -- 2.39.5