@Override
	public void dataTypeReplaced(DataType oldDt, DataType newDt) {
		if (newDt == this) {
			newDt = DataType.DEFAULT;
		}
		lock.acquire();
		try {
			if (checkIsValid() && getDataType() == oldDt) {

				// check for existing pointer to newDt
				PointerDataType newPtr = new PointerDataType(newDt,
					hasLanguageDependantLength() ? -1 : getLength(), dataMgr);
				DataType existingPtr =
					dataMgr.getDataType(newDt.getCategoryPath(), newPtr.getName());
				if (existingPtr != null && existingPtr != this) {
					// avoid duplicate pointer - replace this pointer with existing one
					dataMgr.addDataTypeToReplace(this, existingPtr);
					return;
				}

				if (!newDt.getCategoryPath().equals(oldDt.getCategoryPath())) {
					// move this pointer to same category as newDt
					try {
						super.setCategoryPath(newDt.getCategoryPath());
					}
					catch (DuplicateNameException e) {
						throw new RuntimeException(e); // already checked
					}
				}

				String myOldName = getOldName();
				oldDt.removeParent(this);
				newDt.addParent(this);

				record.setLongValue(PointerDBAdapter.PTR_DT_ID_COL, dataMgr.getResolvedID(newDt));
				refreshName();

				if (!oldDt.getName().equals(newDt.getName())) {
					notifyNameChanged(myOldName);
				}
				try {
					adapter.updateRecord(record);
				}
				catch (IOException e) {
					dataMgr.dbError(e);
				}
			}
		}
		finally {
			lock.release();
		}
	}
Constructor

@param dataMgr
@param cache
@param adapter
@param record
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/PointerDB.java