code: private static int findInlineTagDelim(String inlineText, int searchStart) {
          int delimEnd, nestedOpenBrace;
          if ((delimEnd = inlineText.indexOf("}", searchStart)) == -1) {
              return -1;
          } else if (((nestedOpenBrace = inlineText.indexOf("{", searchStart)) != -1) &&
              nestedOpenBrace < delimEnd){
              //Found a nested open brace.
              int nestedCloseBrace = findInlineTagDelim(inlineText, nestedOpenBrace + 1);
              return (nestedCloseBrace != -1) ?
                  findInlineTagDelim(inlineText, nestedCloseBrace + 1) :
                  -1;
          } else {
              return delimEnd;
          }
      }
docs: Recursively find the index of the closing '}' character for an inline tag
  and return it.  If it can't be found, return -1.
  @param inlineText the text to search in.
  @param searchStart the index of the place to start searching at.
  @return the index of the closing '}' character for an inline tag.
  If it can't be found, return -1.