package be.ac.vub.object_annotations.examples.risky.aspects; import java.util.Scanner; import be.ac.vub.object_annotations.AnnotationManager; import be.ac.vub.object_annotations.examples.risky.annotations.Financial; import be.ac.vub.object_annotations.examples.risky.annotations.Risky; public aspect ApprovalOfRiskyOps { pointcut riskyOperations(double amount, Risky risky) : execution(@Financial * *(..)) && args(amount,..) && @annotation(risky) && if(AnnotationManager.isActive(amount,risky)) ; void around(double amount, Risky risky) : riskyOperations(amount, risky) { 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,risky); } }