@Override public void visitReturnStatement(@NotNull PsiReturnStatement statement) { super.visitReturnStatement(statement); if (!ControlFlowUtils.isInFinallyBlock(statement)) { return; } registerStatementError(statement); }
@Override public void visitMethodCallExpression(@NotNull PsiMethodCallExpression expression) { super.visitMethodCallExpression(expression); if (!MethodCallUtils.isCallToMethod( expression, "java.lang.Thread", PsiType.VOID, "sleep", PsiType.LONG) && !MethodCallUtils.isCallToMethod( expression, "java.lang.Thread", PsiType.VOID, "sleep", PsiType.LONG, PsiType.INT)) { return; } if (!ControlFlowUtils.isInLoop(expression)) { return; } registerMethodCallError(expression); }