use of lombok.ast.ForwardingAstVisitor in project android-priority-jobqueue by yigit.
the class NotifyOnObjectDetector method createJavaVisitor.
@Override
public AstVisitor createJavaVisitor(@NonNull final JavaContext context) {
return new ForwardingAstVisitor() {
@Override
public boolean visitMethodInvocation(MethodInvocation node) {
Expression operand = node.astOperand();
String methodName = node.astName().toString();
if (BAD_METHODS.contains(methodName) && !context.isSuppressedWithComment(node, ISSUE)) {
context.report(ISSUE, context.getLocation(node), "Don't call " + methodName + " directly. Use" + " Timer instead.");
}
return super.visitMethodInvocation(node);
}
};
}
use of lombok.ast.ForwardingAstVisitor in project android-priority-jobqueue by yigit.
the class SystemTimeDetector method createJavaVisitor.
@Override
public AstVisitor createJavaVisitor(@NonNull final JavaContext context) {
return new ForwardingAstVisitor() {
@Override
public boolean visitMethodInvocation(MethodInvocation node) {
Expression operand = node.astOperand();
String methodName = node.astName().toString();
if (BAD_METHODS.contains(methodName) && operand.toString().equals("System") && !context.isSuppressedWithComment(node, ISSUE)) {
context.report(ISSUE, context.getLocation(node), "Don't call " + methodName + " on system. Use" + " Timer instead.");
}
return super.visitMethodInvocation(node);
}
};
}
Aggregations