public synchronized void setLanguage(Language newLanguage, ProgramAddressFactory addrFactory,
			LanguageTranslator translator) throws IOException {

		List<AddressMapEntry> entries = adapter.getEntries();
		List<AddressMapEntry> newEntries = new ArrayList<AddressMapEntry>();

		AddressFactory oldAddressFactory = this.addrFactory;

		this.addrFactory = addrFactory;
		defaultAddrSpace = addrFactory.getDefaultAddressSpace();

		adapter.clearAll();
		adapter.setAddressFactory(addrFactory);

		for (AddressMapEntry entry : entries) {
			if (entry.deleted) {
				newEntries.add(entry);
			}
			else {
				AddressSpace oldSpace = oldAddressFactory.getAddressSpace(entry.name);
				if (oldSpace != null && oldSpace.isLoadedMemorySpace() &&
					!oldSpace.isOverlaySpace()) {
					AddressSpace newSpace = translator.getNewAddressSpace(entry.name);
					if (newSpace != null && (entry.segment == 0 || newSpace.getSize() > 32)) {
						entry.name = newSpace.getName();
					}
					else {
						entry.deleted = true;
					}
				}
				newEntries.add(entry);
			}
		}
		adapter.setEntries(newEntries);

		defaultAddrSpace = addrFactory.getDefaultAddressSpace();
		baseAddrs = adapter.getBaseAddresses(true);
		init(true);
	}
Converts the current base addresses to addresses compatible with the new language.
@param newLanguage the new language to use.
@param addrFactory the new AddressFactory.
@param translator translates address spaces from the old language to the new language.
@throws IOException if IO error occurs
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/map/AddressMapDB.java