code: private void appendVariableDef(String name, StringBuffer buf) {
          char[] ch = variableNames.get(name);
          if (ch == null) {
              // We allow one undefined variable so that variable definition
              // statements work.  For the first undefined variable we return
              // the special placeholder variableLimit-1, and save the variable
              // name.
              if (undefinedVariableName == null) {
                  undefinedVariableName = name;
                  if (variableNext >= variableLimit) {
                      throw new RuntimeException("Private use variables exhausted");
                  }
                  buf.append(--variableLimit);
              } else {
                  throw new IllegalIcuArgumentException("Undefined variable $"
                                                     + name);
              }
          } else {
              buf.append(ch);
          }
      }
docs: Append the value of the given variable name to the given
  StringBuffer.
  @exception IllegalIcuArgumentException if the name is unknown.