while (getMacroByNumber(++x) != null) {} macros.put("macro" + x + "." + name,keyStrokes); macrosExist = true;
if (macrosExist && getMacroByName(name) != null) { Set macroSet = macros.keySet(); Iterator macroIterator = macroSet.iterator(); String byName = null; String prefix = null; while (macroIterator.hasNext()) { byName = (String)macroIterator.next(); if (byName.endsWith(name)) {    prefix = byName.substring(0,byName.indexOf(name)); macros.put(prefix + name,keyStrokes); } } } else {   while (getMacroByNumber(++x) != null) {}  macros.put("macro" + x + "." + name,keyStrokes); macrosExist = true; }
   public final static void setMacro(String name, String keyStrokes) {      int x = 0;      while (getMacroByNumber(++x) != null) {}      macros.put("macro" + x + "." + name,keyStrokes);      macrosExist = true;      saveMacros();   }