void (@NotNull PsiMethodCallExpression expression) { super.visitMethodCallExpression(expression); if (m_numLocksHeld < 2) { return; } final PsiReferenceExpression methodExpression = expression.getMethodExpression(); @NonNls final String methodName = methodExpression.getReferenceName(); if (!HardcodedMethodConstants.WAIT.equals(methodName)) { return; } final PsiMethod method = expression.resolveMethod(); if (method == null) { return; } final PsiParameterList parameterList = method.getParameterList(); final int numParams = parameterList.getParametersCount(); if (numParams > 2) { return; } final PsiParameter[] parameters = parameterList.getParameters(); if (numParams > 0) { final PsiType parameterType = parameters[0].getType(); if (!parameterType.equals(PsiTypes.longType())) { return; } } if (numParams > 1) { final PsiType parameterType = parameters[1].getType(); if (!parameterType.equals(PsiTypes.intType())) { return; } } registerMethodCallError(expression); }