/* */
/* */ private static void checkDeclares(AspectManager manager, NewExpr newcall, MethodCall mcall, ClassAdvisor advisor) throws NotFoundException
/* */ {
/* 82 */ for (Iterator it = manager.getDeclares(); it.hasNext(); )
/* */ {
/* 84 */ DeclareDef declare = (DeclareDef)it.next();
/* */
/* 86 */ StringBuffer sb = new StringBuffer(" condition\n\t'" + declare.getExpr() + "'\nwas broken for ");
/* */
/* 88 */ if (((newcall != null) && (declare.matchesCall(advisor, newcall))) || ((mcall != null) && (declare.matchesCall(advisor, mcall))))
/* */ {
/* 90 */ if (mcall != null)
/* */ {
/* 92 */ sb.append("method call:");
/* 93 */ CtBehavior caller = mcall.where();
/* 94 */ if ((caller instanceof CtConstructor))
/* */ {
/* 96 */ CtConstructor con = (CtConstructor)caller;
/* 97 */ addConstructor(sb, con);
/* 98 */ sb.append(" calls ");
/* 99 */ addMethod(sb, mcall.getMethod());
/* */ }
/* 101 */ else if ((caller instanceof CtMethod))
/* */ {
/* 103 */ CtMethod met = (CtMethod)caller;
/* 104 */ addMethod(sb, met);
/* 105 */ sb.append(" calls ");
/* 106 */ addMethod(sb, mcall.getMethod());
/* */ }
/* */ }
/* 109 */ else if (newcall != null)
/* */ {
/* 111 */ sb.append("constructor call: ");
/* 112 */ CtBehavior caller = newcall.where();
/* 113 */ if ((caller instanceof CtConstructor))
/* */ {
/* 115 */ CtConstructor con = (CtConstructor)caller;
/* 116 */ addConstructor(sb, con);
/* 117 */ sb.append(" calls ");
/* 118 */ addConstructor(sb, newcall.getConstructor());
/* */ }
/* 120 */ else if ((caller instanceof CtMethod))
/* */ {
/* 122 */ CtMethod met = (CtMethod)caller;
/* 123 */ addMethod(sb, met);
/* 124 */ sb.append(" calls ");
/* 125 */ addConstructor(sb, newcall.getConstructor());
/* */ }
/* */ }
/* */
/* 129 */ sb.append("\n\t" + declare.getMsg() + "\n");
/* */
/* 131 */ if (declare.getWarning())
/* */ {
/* 133 */ sb.insert(0, "WARNING: declare-warning");
/* */
/* 135 */ System.out.println(sb.toString());
/* */ }