[abc-dev] Delay initialization of JoinPoint -- maybe not true...

From: Isaac Yuen <isaac.yuen@mail.mcgill.ca>
Date: Thu Mar 30 2006 - 01:37:24 BST

I am just testing about the delayed instantiation of the JointPoint object... so for instance is my aspect is...

public aspect A {
    
    pointcut trace(Object obj) : (execution(* MyComplexInteger+.add(int, int)))
        && target(obj);
        
    Object around(Object obj) : trace(obj){
        int c = 0;
        org.aspectj.lang.JoinPoint jp = thisJoinPoint;
        Object ret = proceed(obj); // proceed needs to match the parameter of the advice
        System.out.println("(A) Target class: "+obj.getClass());
        if (c != 0) {
            System.out.println("(A) Target class (through reflection): "+jp.getTarget().getClass());
        }
        return ret;
    }
}

I expect the JP not initialized until about the branching of the (c != 0) , or not initialized at all

- however, I looked at the jimple and found that the thisJoinPoint object is actually instantiated by makeJP is the MyComplexInteger.add(int, int)...

MyComplexInteger.add(int, int) will call the A.inline() and execute the advice.

Or the nullAnalysis will be enabled by what kind of aspect???

Isaac
Received on Thu Mar 30 01:37:40 2006

This archive was generated by hypermail 2.1.8 : Thu Mar 30 2006 - 02:10:05 BST