Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » How to resolve method binding in advice declaration
How to resolve method binding in advice declaration [message #70639] Sat, 13 October 2007 19:21
Laleh is currently offline LalehFriend
Messages: 10
Registered: July 2009
Junior Member

I am trying to get the information like metho- name, method-parameters and
the type (class) the method belongs to, from the MethodInvocation node in
the AdviceVisitor. The problem is that I can get just the method name and
its arguments, but I cannot get the arguments' type or the type which this
method belong to. Even when I try to resove binding for the method, I get

Here is my code:

public class AdviceVisitor extends AjASTVisitor {

// some code..

public boolean visit(MethodInvocation node) {
ITypeBinding type = node.getExpression().resolveTypeBinding();
IMethodBinding method=node.resolveMethodBinding();
if (type != null && method != null) {
ITypeBinding[] params = method.getParameterTypes();
if (params != null) {
for (int i = 0; i < params.length; i++) {
// some code ..
return true;

It seems that type and the method are "null" and then I get
"java.lang.NullPointerException". Can any one help me to resolve this


Previous Topic:Eclipse Product Export with AspectJ task breaks with separate target platform
Next Topic:ERROR : export - plugin with aspectj support
Goto Forum:

Current Time: Tue May 22 10:10:02 GMT 2018

Powered by FUDForum. Page generated in 0.02101 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top