package lawOfDemeter.objectform; import lawOfDemeter.Any; aspect Check { after(Object thiz,Object target): // check Any.MethodCall(thiz,target) { if (!Global.globalPreferred.contains(target) && !Perthis.aspectOf(thiz).contains(target)) System.out.println(" !! LoD Object Violation !! " + thisJoinPointStaticPart+at(thisJoinPointStaticPart)); } protected String at(org.aspectj.lang.JoinPoint.StaticPart jp) { return " at " + jp.getSourceLocation().getFileName() + ":" + jp.getSourceLocation().getLine() + ":" + jp.getSourceLocation().getColumn(); } }