@Override
	synchronized void clearUndo(boolean notifyListeners) {
		if (!undoList.isEmpty() || !redoList.isEmpty()) {
			undoList.clear();
			redoList.clear();
			DomainFile df = domainObj.getDomainFile();
			if (domainObj.changeSet != null) {
				domainObj.changeSet.clearUndo(df != null && df.isCheckedOut());
			}
			if (notifyListeners) {
				notifyUndoStackChanged();
			}
		}
	}
Returns the undo stack depth (The number of items on the undo stack).

<p>
This method is for JUnits.

@return the undo stack depth
Ghidra/Framework/Project/src/main/java/ghidra/framework/data/DomainObjectTransactionManager.java