KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hammurapi > inspectors > SystemPrintlnLoggingRule


1 /*
2  * Created on 01.03.2004
3  *
4  * To change the template for this generated file go to
5  * Window - Preferences - Java - Code Generation - Code and Comments
6  */

7 package org.hammurapi.inspectors;
8 import org.hammurapi.InspectorBase;
9
10 import com.pavelvlasov.jsel.impl.expressions.MethodCallImpl;
11 /**
12  * @author Johannes
13  *
14  * To change the template for this generated type comment go to Window -
15  * Preferences - Java - Code Generation - Code and Comments
16  */

17 public class SystemPrintlnLoggingRule extends InspectorBase {
18     public void visit(MethodCallImpl method) {
19         /* List l = method.getName().getOperands();
20         Expression serviceClass = (Expression) l.get(0);
21         Expression serviceVar = (Expression) l.get(1);
22         Expression methodName = (Expression) l.get(2);
23         if (serviceClass != null
24                 && serviceVar != null
25                 && methodName != null
26                 && "System".equals(serviceClass.toString())
27                 && "out".equals(serviceVar.toString())
28                 && ("println".equals(methodName.toString()) || "print"
29                         .equals(methodName.toString()))) {
30             context.reportViolation(method);
31         }*/

32         
33         if ( "System.out.println".equals( method.getName().toString() ) ) {
34             context.reportViolation(method);
35         }
36     }
37 }
38
Popular Tags