int i=0; for (Iterator sit = set.iterator(); sit.hasNext();) {
int i = 0; for (String match : set) {
    public static void getObjects(String text, Document doc) throws ObjectHandlerException, ServiceException {        if (DebugConfig.disableObjects)            return;        List objects = ObjectHandler.getObjectHandlers();        StringBuffer l_objects = new StringBuffer();        for (Iterator oit=objects.iterator(); oit.hasNext();) {            ObjectHandler h = (ObjectHandler) oit.next();            if (!h.isIndexingEnabled())                continue;            ArrayList matchedObjects = new ArrayList();            h.parse(text, matchedObjects, true);            if (!matchedObjects.isEmpty()) {                     if (l_objects.length() > 0)                    l_objects.append(',');                l_objects.append(h.getType());                if (false /*h.storeMatched()*/) {                    HashSet set = new HashSet();                    for (Iterator mit = matchedObjects.iterator(); mit.hasNext(); ) {                        MatchedObject mo = (MatchedObject) mit.next();                        set.add(mo.getMatchedText());                    }                                    StringBuffer md = new StringBuffer();                    int i=0;                                    for (Iterator sit = set.iterator(); sit.hasNext();) {                        //TODO: check md.length() and set an upper bound on                        // how big we'll let the field be? Per-object or                         // system-wide policy?                        BlobMetaData.encodeMetaData(Integer.toString(i++), (String)sit.next(), md);                    }                    String fname = "l.object."+h.getType();                    doc.add(Field.UnIndexed(fname, md.toString()));                }            }        }        if (l_objects.length() > 0)        	doc.add(Field.UnStored(LuceneFields.L_OBJECTS, l_objects.toString()));    }