public void run() {
		gotoNextState(); // initialize the currentState.

		while (currentState != DONE) {
			try {
				processState(currentState);
			}
			catch (CancelledException ex) {
				// handled in gotoNextState
			}
			catch (Exception e) {
				if (!isFired) {
					Msg.error(this, "Unexpected Exception: " + e.getMessage(), e);
					break;
				}
			}

			gotoNextState();
		}
	}
The basic run() method that executes the state machine.
Ghidra/Framework/Docking/src/main/java/docking/widgets/table/threaded/TableUpdateJob.java