| Code with Finding: |
class DocInverter {
void flush(Map threadsAndFields, SegmentWriteState state) throws IOException {
Map childThreadsAndFields = new HashMap();
Map endChildThreadsAndFields = new HashMap();
Iterator it = threadsAndFields.entrySet().iterator();
while(it.hasNext()) {
Map.Entry entry = (Map.Entry) it.next();
DocInverterPerThread perThread = (DocInverterPerThread) entry.getKey();
Collection fields = (Collection) entry.getValue();
Iterator fieldsIt = fields.iterator();
Collection childFields = new HashSet();
Collection endChildFields = new HashSet();
while(fieldsIt.hasNext()) {
DocInverterPerField perField = (DocInverterPerField) fieldsIt.next();
childFields.add(perField.consumer);
endChildFields.add(perField.endConsumer);
}
childThreadsAndFields.put(perThread.consumer, childFields);
endChildThreadsAndFields.put(perThread.endConsumer, endChildFields);
}
consumer.flush(childThreadsAndFields, state);
endConsumer.flush(endChildThreadsAndFields, state);
}
}
|