public static void checkState()

in hadoop-api-shim/src/main/java/org/apache/hadoop/fs/shim/impl/Preconditions.java [309:324]


  public static void checkState(
      final boolean expression,
      final Supplier<String> msgSupplier) {
    if (!expression) {
      String msg;
      try {
        // note that we can get NPE evaluating the message itself;
        // but we do not want this to override the actual NPE.
        msg = msgSupplier.get();
      } catch (Exception e) {
        LOG.debug("Error formatting message", e);
        msg = CHECK_STATE_EX_MESSAGE;
      }
      throw new IllegalStateException(msg);
    }
  }