@Override
 public void visitMethodCallExpression(final PsiMethodCallExpression expression) {
   if (myCollectExpressions) {
     final PsiMethod psiMethod = expression.resolveMethod();
     if (psiMethod != null
         && !DebuggerUtils.hasSideEffectsOrReferencesMissingVars(expression, myVisibleLocals)) {
       myExpressions.add(new TextWithImportsImpl(expression));
     }
   }
   super.visitMethodCallExpression(expression);
 }
Esempio n. 2
0
 @Override
 public void visitMethodCallExpression(@NotNull PsiMethodCallExpression call) {
   if (containsAssertion) {
     return;
   }
   super.visitMethodCallExpression(call);
   final PsiReferenceExpression methodExpression = call.getMethodExpression();
   @NonNls final String methodName = methodExpression.getReferenceName();
   if (methodName == null) {
     return;
   }
   if (methodName.startsWith("assert") || methodName.startsWith("fail")) {
     containsAssertion = true;
   }
 }
 @Override
 public void visitMethodCallExpression(@NotNull PsiMethodCallExpression call) {
   if (read || written) {
     return;
   }
   super.visitMethodCallExpression(call);
   final PsiExpressionList argumentList = call.getArgumentList();
   final PsiExpression[] arguments = argumentList.getExpressions();
   for (final PsiExpression argument : arguments) {
     final VariableUsedVisitor visitor = new VariableUsedVisitor(variable);
     argument.accept(visitor);
     if (visitor.isUsed()) {
       read = true;
       reference = visitor.getReference();
       return;
     }
   }
 }
    public void visitMethodCallExpression(PsiMethodCallExpression psiMethodCallExpression) {
      PsiReference reference = psiMethodCallExpression.getMethodExpression().getReference();
      if (reference == null) {
        return;
      }
      PsiElement e = reference.resolve();
      if (e instanceof PsiMethod) {
        assert myBaseMethod != null;
        PsiMethod m = (PsiMethod) e;
        if (m.getContainingClass() == myBaseMethod.getContainingClass()) {
          myInfo.registerDependency(myBaseMethod, m);
        }
      }

      // We process all method call expression children because there is a possible case like below:
      //   new Runnable() {
      //     void test();
      //   }.run();
      // Here we want to process that 'Runnable.run()' implementation.
      super.visitMethodCallExpression(psiMethodCallExpression);
    }