@Override
    public void visitIfStatement(@NotNull GrIfStatement statement) {
      super.visitIfStatement(statement);
      final GrExpression outerCondition = statement.getCondition();
      if (outerCondition == null) {
        return;
      }
      if (SideEffectChecker.mayHaveSideEffects(outerCondition)) {
        return;
      }
      GrStatement thenBranch = statement.getThenBranch();
      if (thenBranch == null) {
        return;
      }
      thenBranch = ControlFlowUtils.stripBraces(thenBranch);
      if (!(thenBranch instanceof GrSynchronizedStatement syncStatement)) {
        return;
      }
      final GrCodeBlock body = syncStatement.getBody();
      if (body == null) {
        return;
      }
      final GrStatement[] statements = body.getStatements();
      if (statements.length != 1) {
        return;
      }
      if (!(statements[0] instanceof GrIfStatement innerIf)) {
        return;
      }
      final GrExpression innerCondition = innerIf.getCondition();
      if (innerCondition == null) {
        return;
      }
      if (!EquivalenceChecker.expressionsAreEquivalent(innerCondition, outerCondition)) {
        return;
      }
      if (ignoreOnVolatileVariables &&
          ifStatementAssignsVolatileVariable(innerIf)) {
        return;
      }
      registerStatementError(statement);
    }
@Override
    public void visitIfStatement(@NotNull GrIfStatement statement)