01: /*
02: * Created on 01.03.2004
03: *
04: * To change the template for this generated file go to
05: * Window - Preferences - Java - Code Generation - Code and Comments
06: */
07: package org.hammurapi.inspectors;
08:
09: import org.hammurapi.InspectorBase;
10:
11: import com.pavelvlasov.jsel.impl.expressions.MethodCallImpl;
12:
13: /**
14: * @author Johannes
15: *
16: * To change the template for this generated type comment go to Window -
17: * Preferences - Java - Code Generation - Code and Comments
18: */
19: public class SystemPrintlnLoggingRule extends InspectorBase {
20: public void visit(MethodCallImpl method) {
21: /* List l = method.getName().getOperands();
22: Expression serviceClass = (Expression) l.get(0);
23: Expression serviceVar = (Expression) l.get(1);
24: Expression methodName = (Expression) l.get(2);
25: if (serviceClass != null
26: && serviceVar != null
27: && methodName != null
28: && "System".equals(serviceClass.toString())
29: && "out".equals(serviceVar.toString())
30: && ("println".equals(methodName.toString()) || "print"
31: .equals(methodName.toString()))) {
32: context.reportViolation(method);
33: }*/
34:
35: if ("System.out.println".equals(method.getName().toString())) {
36: context.reportViolation(method);
37: }
38: }
39: }
|