@Override
	public boolean applyTo(Program program) {
		EquateTable etable = program.getEquateTable();

		// See if there's an entry in the table for the old equate name.  There should be,
		// otherwise there's a problem.
		Equate fromEquate = etable.getEquate(oldEquateName);
		if (fromEquate == null) {
			msg = "Equate not found: " + oldEquateName;
			return false;
		}

		// Now get the entry in the Equate table for the new equate name.  If there's
		// already an entry with this name, just use that...otherwise, create a new one.
		Equate toEquate = etable.getEquate(newEquateName);
		if (toEquate == null) {
			try {
				toEquate = etable.createEquate(newEquateName, fromEquate.getValue());
			}
			catch (DuplicateNameException e) {
				throw new AssertException();
			}
			catch (InvalidInputException e) {
				msg = "Invalid equate name: " + newEquateName;
				return false;
			}
		}

		// Finally, move all references to the old equate to the new one.
		EquateReference[] refList = fromEquate.getReferences();
		etable.removeEquate(oldEquateName);
		for (EquateReference element : refList) {
			toEquate.addReference(element.getAddress(), element.getOpIndex());
		}
		return true;
	}
Constructor
@param oldEquateName the name of equate to be renamed.
@param newEquateName the new name for the equate
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/equate/RenameEquatesCmd.java