1 2 3 4 5 6 7 8 9 10 11 12 13
public aspect ProblemAspect { pointcut init(): initialization(Object+.new(..)); pointcut staticinit(): staticinitialization(Object+); Class around(String className): cflowbelow(init() || staticinit()) && call(Class Class.forName(String)) && args(className) { System.out.println("Test"); return proceed(className); } }