public void initStateFrom(@NotNull ProgressIndicator indicator) {
    synchronized (getLock()) {
      myRunning = indicator.isRunning();
      myCanceled = indicator.isCanceled();
      boolean indeterminate = indicator.isIndeterminate();
      setIndeterminate(indeterminate);
      // avoid "This progress indicator is indeterminate blah blah"
      if (!indeterminate || indicator.getFraction() != 0) {
        setFraction(indicator.getFraction());
      }
      setText(indicator.getText());
      setText2(indicator.getText2());

      if (indicator instanceof AbstractProgressIndicatorBase) {
        AbstractProgressIndicatorBase stacked = (AbstractProgressIndicatorBase)indicator;
        myStateStack = stacked.myStateStack == null ? null : new Stack<>(stacked.getStateStack());
      }
      dontStartActivity();
    }
  }
public void initStateFrom(@NotNull ProgressIndicator indicator)