code: private static String getBlock(String str, char open, char close, 
                                  IntWritable index) throws ParseException {
      StringBuilder split = new StringBuilder();
      int next = StringUtils.findNext(str, open, StringUtils.ESCAPE_CHAR, 
                                      index.get(), split);
      split.setLength(0); // clear the buffer
      if (next >= 0) {
        ++next; // move over '('
        
        next = StringUtils.findNext(str, close, StringUtils.ESCAPE_CHAR, 
                                     next, split);
        if (next >= 0) {
          ++next; // move over ')'
          index.set(next);
          return split.toString(); // found a block
        } else {
          throw new ParseException("Unexpected end of block", next);
        }
      }
      return null; // found nothing
    }
docs: returns null.