protected static String regRangeString(RegisterSpecList list) {
    int size = list.size();
    StringBuilder sb = new StringBuilder(30);

    sb.append("{");

    switch (size) {
      case 0:
        {
          // Nothing to do.
          break;
        }
      case 1:
        {
          sb.append(list.get(0).regString());
          break;
        }
      default:
        {
          RegisterSpec lastReg = list.get(size - 1);
          if (lastReg.getCategory() == 2) {
            /*
             * Add one to properly represent a list-final
             * category-2 register.
             */
            lastReg = lastReg.withOffset(1);
          }

          sb.append(list.get(0).regString());
          sb.append("..");
          sb.append(lastReg.regString());
        }
    }

    sb.append("}");

    return sb.toString();
  }
Helper method to return a register range string.

@param list {@code non-null;} the list of registers (which must be sequential)
@return {@code non-null;} the string form
android/android_framework/dex-maker/src/main/java/com/android/dx/dex/code/InsnFormat.java