protected final void validateDefaultSpaceMap() throws IncompatibleLanguageException {

		if (spaceMap != null) {
			return;
		}

		AddressFactory oldFactory = oldLanguage.getAddressFactory();
		AddressFactory newFactory = newLanguage.getAddressFactory();

		ArrayList<AddressSpace> oldSpaces =
			new ArrayList<AddressSpace>(Arrays.asList(oldFactory.getAddressSpaces()));
		ArrayList<AddressSpace> newSpaces =
			new ArrayList<AddressSpace>(Arrays.asList(newFactory.getAddressSpaces()));

		AddressSpace oldDefaultSpace = oldFactory.getDefaultAddressSpace();
		AddressSpace newDefaultSpace = newFactory.getDefaultAddressSpace();
		if (oldDefaultSpace.getSize() > newDefaultSpace.getSize()) {
			throw new IncompatibleLanguageException(
				"Old language has larger default address space (" + oldDefaultSpace.getSize() +
					"-bit vs. " + newDefaultSpace.getSize() + "-bit) than the new language");
		}

		spaceMap = new HashMap<String, AddressSpace>();

		spaceMap.put(oldDefaultSpace.getName(), newDefaultSpace);
		spaceMap.put(oldFactory.getRegisterSpace().getName(), newFactory.getRegisterSpace());
		oldSpaces.remove(oldDefaultSpace);
		newSpaces.remove(newDefaultSpace);

		// first try to match spaces by name
		Iterator<AddressSpace> spaceIt = oldSpaces.iterator();
		while (spaceIt.hasNext()) {
			AddressSpace oldSpace = spaceIt.next();
			if (!oldSpace.isLoadedMemorySpace() || oldSpace.getType() == AddressSpace.TYPE_CODE) {
				spaceIt.remove();
			}
			else {
				AddressSpace newSpace = findSpaceSameName(oldSpace, newSpaces);
				if (newSpace != null) {
					spaceMap.put(oldSpace.getName(), newSpace);
					newSpaces.remove(newSpace);
					spaceIt.remove();
				}
			}
		}

		// now try to match spaces by attributes
//		spaceIt = oldSpaces.iterator();
//		while(spaceIt.hasNext()) {
//			AddressSpace oldSpace = spaceIt.next();
//			AddressSpace newSpace = findSpaceSameName(oldSpace, newSpaces);
//			if (newSpace != null) {
//				spaceMap.put(oldSpace.getName(), newSpace);
//				newSpaces.remove(newSpace);
//			}
//		}

		if (!oldSpaces.isEmpty()) {
//			spaceMap = null;
			throw new IncompatibleLanguageException(
				"Failed to map one or more address spaces: " + oldSpaces);
		}

	}
Build and validate the default address space map.  This method must be invoked following instantiation
if the default address space mapping will be used.
@throws IncompatibleLanguageException if a default mapping of the address spaces could not be identified.
@see #getNewAddressSpace(String)
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/util/LanguageTranslatorAdapter.java