[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [aspectj-users] Null static part of the thisJoinPoint
|
One thing I can think of is that some of your java methods may return a void, but your code below requires that an Object be returned; that might be the reason you get an exception. Try remove the parameter "Object t" from your code.
after () returning (Object t): methodExec() {
thisJoinPoint.getSignature();
}
Feilong
>From: Mohamed Mansour
>Reply-To: aspectj-users@xxxxxxxxxxx
>To: aspectj-users
>Subject: [aspectj-users] Null static part of the thisJoinPoint
>Date: Wed, 23 Apr 2003 08:01:20 -0400
>
>Hi,
>
>I am getting a NullPointerException in my advice code. the
>thisJoinPoint is not null, a call to thisJoinPoint.getStaticPart()
>returns null.
>
>Here is a stripped down version of the aspect I used:
>
>public aspect BaseAspect { pointcut methodExec():
> pointcut myTrace(): within(BaseAspect);
> pointcut javaCode(): within(java..*) || call(* java..*(..));
> pointcut methodExec():
> execution(* net.sf.jode..*(..))
> && !javaCode()
> && !myTrace()
> && !execution(public static void *..main(String []));
>
> after () returning (Object t): methodExec() {
> thisJoinPoint.getSignature();
> }
>}
>
>and here is the stack dump:
>
>
>java.lang.NullPointerException
> at
>org.aspectj.runtime.reflect.JoinPointImpl.getSignature(JoinPointImpl.java:70)
> at
>BaseAspect.ajc$afterReturning$BaseAspect$600(BaseAspect.java:50)
> at net.sf.jode.expr.NoArgOperator.updateSubTypes(Unknown
>Source)
> at net.sf.jode.expr.Operator.initOperands(Unknown Source)
> at net.sf.jode.expr.NoArgOperator.(Unknown Source)
> at net.sf.jode.expr.NoArgOperator.(Unknown Source)
> at net.sf.jode.expr.ConstOperator.(Unknown Source)
> at net.sf.jode.expr._expression_.(Unknown Source)
> at net.sf.jode.decompiler.MethodAnalyzer.analyze(Unknown
>Source)
> at net.sf.jode.decompiler.ClassAnalyzer.analyze(Unknown
>Source)
> at net.sf.jode.decompiler.ClassAnalyzer.dumpJavaFile(Unknown
>Source)
> at net.sf.jode.decompiler.ClassAnalyzer.dumpJavaFile(Unknown
>Source)
> at net.sf.jode.decompiler.Main.decompileClass(Unknown
>Source)
> at net.sf.jode.decompiler.Main.decompile(Unknown Source)
> at net.sf.jode.decompiler.Main.main(Unknown Source)
>
>
>_______________________________________________
>aspectj-users mailing list
>aspectj-users@xxxxxxxxxxx
>http://dev.eclipse.org/mailman/listinfo/aspectj-users
Add photos to your e-mail with
MSN 8. Get 2 months FREE*.