private boolean setName(Program program, String oldN, String newN) {
		Listing listing = program.getListing();
		try {
			if (isModule) {
				ProgramModule m = listing.getModule(treeName, oldN);
				m.setName(newN);
			}
			else {
				ProgramFragment f = listing.getFragment(treeName, oldN);
				f.setName(newN);
			}
			return true;
		}
		catch (DuplicateNameException e) {
			if (ignoreDuplicateName) {
				newName = oldName;
				return true;
			}
			statusMsg = "Name already exists for " + newN;
		}
		return false;
	}
Construct a new RenameCmd.
@param treeName name of the tree where the module or fragment resides
@param isModule true if a module is to be renamed
@param oldName current name of the module or fragment
@param newName new name for the module or fragment
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/module/RenameCmd.java