@Override
 public void visitReturnStatement(@NotNull PsiReturnStatement statement) {
   super.visitReturnStatement(statement);
   if (!ControlFlowUtils.isInFinallyBlock(statement)) {
     return;
   }
   registerStatementError(statement);
 }
Ejemplo n.º 2
0
 @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);
 }