I'm trying to create specific class constructor pointcut execution but I get the following marker:
Aspect code:
public aspect CarLogger {
private Logger logger;
pointcut instantiate() : execution (Car.new(..));
after() : instantiate(){
logger.log(Level.INFO, "In Car::Car()", thisJoinPoint.getThis());
}
this code returns no match for this type name Car.
But if I change execution (Car.new(..))
to execution (*.new(..))
I get all constructors in the project.
My wish is to have the pointcut execute only to the specific class Car
I think it is because pointcut is not able to map
Car
with your class, as you have not specified proper path to it i.e. full namealong with package
.