void (PsiCodeBlock body) { final PsiStatement[] statements = body.getStatements(); for (final PsiStatement statement : statements) { if (isConditional(statement)) { return; } if (!(statement instanceof PsiExpressionStatement)) { continue; } final PsiExpression firstExpression = ((PsiExpressionStatement)statement).getExpression(); if (!(firstExpression instanceof PsiMethodCallExpression methodCallExpression)) { continue; } final PsiReferenceExpression methodExpression = methodCallExpression.getMethodExpression(); @NonNls final String methodName = methodExpression.getReferenceName(); if (!HardcodedMethodConstants.WAIT.equals(methodName)) { continue; } final PsiMethod method = methodCallExpression.resolveMethod(); if (method == null) { continue; } final PsiParameterList parameterList = method.getParameterList(); final int numParams = parameterList.getParametersCount(); if (numParams > 2) { continue; } final PsiParameter[] parameters = parameterList.getParameters(); if (numParams > 0) { final PsiType parameterType = parameters[0].getType(); if (!parameterType.equals(PsiTypes.longType())) { continue; } } if (numParams > 1) { final PsiType parameterType = parameters[1].getType(); if (!parameterType.equals(PsiTypes.intType())) { continue; } } registerMethodCallError(methodCallExpression); } }