public void save(Program program) throws IOException {
		int id = -1;
		Integer idInt = openPrograms.get(program);
		if (idInt != null) {
			id = idInt.intValue();
		}
		if (id >= 0) {
			program.endTransaction(id, true);
		}
		try {
			program.getDomainFile().save(MONITOR);
		}
		catch (CancelledException e) {
			throw new IOException("Cancelled");
		}
		if (id >= 0) {
			openPrograms.put(program, Integer.valueOf(program.startTransaction("")));
		}
	}
Saves any changes in the program back to its file. If the program does
not have an associated file (it was created), then it is an error to call
this method, use saveAs instead.
Any open transaction will be terminated.
@param program
           the program to be saved.
@throws IOException
            if there was a problem accessing the program
Ghidra/Features/Base/src/main/java/ghidra/base/project/GhidraProject.java