// the aspect for counting the total weight of the basket aspect BasketMainCount { static int returnVal; int Basket.totalWeight1() { returnVal = 0; t1(); return returnVal; } int Basket.totalWeight2() { returnVal = 0; t2(); return returnVal; } pointcut t2WeightPC(Weight weight) : (call(* *t2*()) || call(* *t1*())) && target(weight); before(Weight weight) : t2WeightPC(weight) { returnVal += weight.get_i(); } }