@Override
	protected Object clone() {
		ProgramDiff diff = null;
		try {
			diff = new ProgramDiff(program1, program2, checkAddressSet);

			diff.ignoreAddressSet.add(this.ignoreAddressSet);
			diff.restrictAddressSet = new AddressSet(this.restrictAddressSet);
			diff.pdf = this.pdf;
			diff.diffAddrSets = new Hashtable<>(this.diffAddrSets);
			for (Enumeration<Integer> enu = diff.diffAddrSets.keys(); enu.hasMoreElements();) {
				Integer key = enu.nextElement();
				AddressSet addrSet = diff.diffAddrSets.get(key);
				diff.diffAddrSets.put(key, new AddressSet(addrSet));
			}
			diff.cancelled = this.cancelled;
			diff.currentDiffs = new AddressSet(this.currentDiffs);
			diff.diffsToReturn = new AddressSet(this.diffsToReturn);
			diff.filterChanged = this.filterChanged;
			diff.sameProgramContext = this.sameProgramContext;
			diff.warnings = (this.warnings == null) ? null : new String(this.warnings);
		}
		catch (ProgramConflictException exc) {
			Msg.error(this, "Unexpected Exception: " + exc.getMessage(), exc);
		}

		return diff;
	}
Returns a copy of this ProgramDiff.
@return the copy of this ProgramDiff or null if a
MemoryConflictException occurs.
Ghidra/Features/Base/src/main/java/ghidra/program/util/ProgramDiff.java