@Override public void visitMethodInvocation(MethodInvocationTree tree) { if (tree.equals(methodInvocationTree)) { //stop inspection, all concerned usages have been visited. stopInspection = true; } else { super.visitMethodInvocation(tree); } }
@Override public void visitMethodInvocation(MethodInvocationTree methodInvocation) { if (securingInvocationPredicate.test(methodInvocation)) { isExternalEntityProcessingDisabled = true; } super.visitMethodInvocation(methodInvocation); } }
@Override public void visitMethodInvocation(MethodInvocationTree methodInvocation) { super.visitMethodInvocation(methodInvocation); Symbol calleeMethodSymbol = methodInvocation.symbol(); if (methodsPropagationMap.containsKey(calleeMethodSymbol) && methodInvocationOnThisInstance(methodInvocation)) { String calleePropagation = methodsPropagationMap.get(calleeMethodSymbol); checkIncompatiblePropagation(methodInvocation, callerPropagation, calleeMethodSymbol, calleePropagation); } } });
@Override public void visitMethodInvocation(MethodInvocationTree tree) { if (ENUM_VALUE_OF.matches(tree)) { hasEnumValueOf = true; } super.visitMethodInvocation(tree); }
@Override public void visitMethodInvocation(MethodInvocationTree tree) { useDescription |= FEST_AS_METHOD.matches(tree); super.visitMethodInvocation(tree); }
@Override public void visitMethodInvocation(MethodInvocationTree tree) { if (methodMatcher.matches(tree) && synchronizedStack.peek().value >= 2) { matchedMethods.add(tree); } super.visitMethodInvocation(tree); }
@Override public void visitMethodInvocation(MethodInvocationTree methodInvocation) { if (NEXT_INVOCATION_MATCHER.matches(methodInvocation) || throwsNoSuchElementException(methodInvocation)) { foundThrow = true; } super.visitMethodInvocation(methodInvocation); }
@Override public void visitMethodInvocation(MethodInvocationTree tree) { super.visitMethodInvocation(tree); visitMethodSymbol(tree.symbol()); }
@Override public void visitMethodInvocation(MethodInvocationTree tree) { if (SUPER_THREAD.matches(tree) && ThreadOverridesRunCheck.hasRunnableArgument(tree.arguments())) { callSuperWithRunnable = true; // no need to visit further return; } super.visitMethodInvocation(tree); }
@Override public void visitMethodInvocation(MethodInvocationTree tree) { checkIfThrowThrowable(tree.symbol()); super.visitMethodInvocation(tree); }
@Override public void visitMethodInvocation(MethodInvocationTree tree) { if (tree.symbol().isMethodSymbol()) { for (Type thrownType : ((Symbol.MethodSymbol) tree.symbol()).thrownTypes()) { exceptionsThrownByMethodInvocations.add(thrownType); } } super.visitMethodInvocation(tree); }
@Override public void visitMethodInvocation(MethodInvocationTree tree) { checkMethodInvocationArgument(tree.arguments(), tree.symbol()); super.visitMethodInvocation(tree); }
@Override public void visitMethodInvocation(MethodInvocationTree tree) { if (tree.symbol().isUnknown()) { context.reportIssue(this, methodName(tree.methodSelect()), "Method not resolved"); } super.visitMethodInvocation(tree); }
@Override public void visitMethodInvocation(MethodInvocationTree tree) { Symbol symbol = tree.symbol(); if (!symbol.isUnknown() && symbol.owner().type().isSubtypeOf("java.lang.Thread") && "interrupt".equals(symbol.name()) && tree.arguments().isEmpty()) { threadInterrupted = true; return; } super.visitMethodInvocation(tree); }
@Override public void visitMethodInvocation(MethodInvocationTree tree) { if (tree.methodSelect().is(Tree.Kind.MEMBER_SELECT)) { MemberSelectExpressionTree mse = (MemberSelectExpressionTree) tree.methodSelect(); if (mse.expression().is(Tree.Kind.IDENTIFIER) && "super".equals(((IdentifierTree) mse.expression()).name()) && mse.identifier().name().equals(methodName)) { superCallOnOverride |= !((IdentifierTree) mse.expression()).symbol().type().is(JUNIT_FRAMEWORK_TEST_CASE); } } super.visitMethodInvocation(tree); }
@Override public void visitMethodInvocation(MethodInvocationTree tree) { Symbol method = tree.symbol(); if ("next".equals(method.name()) && tree.arguments().isEmpty() && isIteratorMethod(method) && (hasNextOwner == method.owner() || hasNextOwner.type().isSubtypeOf(method.owner().type()))) { reportIssue(ExpressionUtils.methodName(tree), "Refactor the implementation of this \"Iterator.hasNext()\" method to not call \"Iterator.next()\"."); } super.visitMethodInvocation(tree); }
@Override public void visitMethodInvocation(MethodInvocationTree tree) { if(tree.symbol().isMethodSymbol()) { Type type = tree.symbol().owner().type(); if (isCheckedType(type)) { reportIssue(ExpressionUtils.methodName(tree), "Remove this assertion."); } } super.visitMethodInvocation(tree); }
@Override public void visitMethodInvocation(MethodInvocationTree tree) { Symbol symbol = tree.symbol(); if (tree.methodSelect().is(Tree.Kind.IDENTIFIER) && isCallToSuperclassMethod(symbol)) { String methodName = ((IdentifierTree) tree.methodSelect()).name(); reportIssue(ExpressionUtils.methodName(tree), "Prefix this call to \"" + methodName + "\" with \"super.\"."); } super.visitMethodInvocation(tree); }
@Override public void visitMethodInvocation(MethodInvocationTree tree) { if (tree.methodSelect().is(Tree.Kind.MEMBER_SELECT)) { MemberSelectExpressionTree memberSelect = (MemberSelectExpressionTree) tree.methodSelect(); boolean issue = ("equals".equals(memberSelect.identifier().name())) && (isToUpperCaseOrToLowerCase(memberSelect.expression()) || (tree.arguments().size() == 1 && isToUpperCaseOrToLowerCase(tree.arguments().get(0)))); if (issue) { context.reportIssue(this, tree, "Replace these toUpperCase()/toLowerCase() and equals() calls with a single equalsIgnoreCase() call."); } } super.visitMethodInvocation(tree); }
@Override public void visitMethodInvocation(MethodInvocationTree tree) { if (tree.methodSelect().is(Tree.Kind.IDENTIFIER)) { Symbol symbol = ((IdentifierTree) tree.methodSelect()).symbol(); usesThisInstance |= symbol.isMethodSymbol() && !symbol.isStatic() && instanceType.isSubtypeOf(symbol.owner().type()); } super.visitMethodInvocation(tree); }