package be.ac.vub.object_annotations.examples.risky.onlyAJ; import java.util.Scanner; import be.ac.vub.object_annotations.examples.risky.annotations.Financial; public aspect AJApprovalOfRiskyOps { pointcut financialOp(double amount) : execution(@Financial * *.*(double,..)) && args(amount,..); pointcut limitwithdraws(double amount) : financialOp(amount) && execution(* *.withdraw(..)) && if(amount > 500); pointcut limittransfer(double amount) : financialOp(amount) && execution(* *.transfer(..)) && if(amount > 1500 || amount < 0.01); void around(double amount) : limitwithdraws(amount) || limittransfer(amount) { System.out.println(" Risky operation detected. - "+thisJoinPoint.toShortString()+" for "+amount+" - Proceed? Y/N"); Scanner in = new Scanner(System.in); String answer = in.next("[yn]|[Y|N]"); if(answer.equalsIgnoreCase("y")) proceed(amount); } }