I'm writing an aspect for making that possible for dependencies from external libraries to return values that are correctly formatted for my application.
With this in mind, I've created an annotation with name @SafeReturns. I wire this class from the external library with the help of spring and in addition, I add my annotation.
@SafeReturns
@Autowired
public PermissionsClient client;
Now I try to make an aspect of it, but unfortunately, I can't catch all the calls to all the methods on the field annotated with this annotation. I tried different pointcuts. e.g.
@Pointcut("execution(@myApp.SafeReturns * *(..))")
@Around("safeReturnsPointCut()")
public void logAround(ProceedingJoinPoint joinPoint) throws Throwable {
}
None of them helps me to achieve the behaviour of catching all the methods. Is there a way to catch them?