@Override public boolean visitMethodInvocation(MethodInvocation node) { Expression operand = node.astOperand(); if (node.astName().toString().equals("sleep") && operand.toString().equals("Thread") && !context.isSuppressedWithComment(node, ISSUE)) { context.report(ISSUE, node, context.getLocation(node), "Don't call sleep. Use MockTimer instead."); } return super.visitMethodInvocation(node); } };
@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); } };
@Override public boolean visitMethodInvocation(MethodInvocation node) { Expression operand = node.astOperand(); if (node.astName().toString().equals("wait") && !context.isSuppressedWithComment(node, ISSUE)) { context.report(ISSUE, context.getLocation(node), "Don't wait on object. Use Timer's wait instead."); } return super.visitMethodInvocation(node); } };
@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); } };
@Override public boolean visitMethodInvocation(MethodInvocation node) { if (node == mFrom) { mReachable = true; } else if (node == mTo) { mSeenEnd = true; } return super.visitMethodInvocation(node); }
@Override public boolean visitMethodInvocation(MethodInvocation call) { if (mContainsCleanup) { return true; } super.visitMethodInvocation(call); if (isCleanupCall(call)) { mContainsCleanup = true; return true; } else { return false; } }
@Override public boolean visitMethodInvocation(MethodInvocation node) { if (node == mTarget) { mDone = true; } String name = node.astName().astValue(); if ((name.startsWith("check") || name.startsWith("enforce")) && name.endsWith("Permission")) { mChecksPermission = true; mDone = true; } return super.visitMethodInvocation(node); }
@Override public boolean visitMethodInvocation(MethodInvocation node) { if (node == mTargetNode) { Expression arg = getTargetArgument(); if (arg instanceof VariableReference) { VariableReference reference = (VariableReference) arg; String variable = reference.astIdentifier().astValue(); mName = mMap.get(variable); mDone = true; return true; } } // Is this a getString() call? On a resource object? If so, // promote the resource argument up to the left hand side return super.visitMethodInvocation(node); }
@Override public boolean visitMethodInvocation(MethodInvocation node) { if (SET_SMALL_ICON.equals(node.astName().astValue())) { StrictListAccessor<Expression,MethodInvocation> arguments = node.astArguments(); if (arguments.size() == 1 && arguments.first() instanceof Select) { handleSelect((Select) arguments.first()); } } return super.visitMethodInvocation(node); } }
return super.visitMethodInvocation(node);
return super.visitMethodInvocation(node);
return super.visitMethodInvocation(node);