

def _process_tuples(self, class_tuples, progress_monitor):
    method_tuples = []
    field_tuples = []
    count = 0
    progress_monitor.info('Processing {0} classes'.format(len(class_tuples)))
    progress_monitor.start('Processing classes', len(class_tuples))
    log = gl.LinkerLog(self, ('generic-' + self.class_kind.kind))
    for (reference, simple, fqn, class_elements, method_elements, field_elements) in class_tuples:
        if (len(class_elements) > 0):
            (code_element, potentials) = self.class_linker.get_code_element(reference, class_elements, simple, fqn, log, True)
            if (code_element is not None):
                count += gl.save_link(reference, code_element, potentials, self)
            else:
                method_tuples.append((reference, simple, fqn, method_elements, field_elements))
        else:
            method_tuples.append((reference, simple, fqn, method_elements, field_elements))
        progress_monitor.work('Processed a class', 1)
    progress_monitor.done()
    log.close()
    progress_monitor.info('Processed classes')
    progress_monitor.info('Processing {0} methods'.format(len(method_tuples)))
    progress_monitor.start('Processing methods', len(method_tuples))
    log = gl.LinkerLog(self, ('generic-' + self.method_kind.kind))
    for (reference, simple, fqn, method_elements, field_elements) in method_tuples:
        if (len(method_elements) > 0):
            fqn_container = je.get_package_name(fqn)
            if (fqn_container == simple):
                fqn_container = None
            method_info = MethodInfo(simple, fqn_container, None, None)
            (code_element, potentials) = self.method_linker.get_code_element(reference, method_elements, method_info, log)
            if (code_element is not None):
                count += gl.save_link(reference, code_element, potentials, self)
            else:
                field_tuples.append((reference, simple, fqn, field_elements))
        else:
            field_tuples.append((reference, simple, fqn, field_elements))
        progress_monitor.work('Processed method', 1)
    progress_monitor.done()
    log.close()
    progress_monitor.info('Processed methods')
    progress_monitor.info('Processing {0} fields'.format(len(field_tuples)))
    progress_monitor.start('Processing fields', len(field_tuples))
    log = gl.LinkerLog(self, ('generic-' + self.field_kind.kind))
    for (reference, simple, fqn, field_elements) in field_tuples:
        if (len(field_elements) > 0):
            fqn_container = je.get_package_name(fqn)
            if (fqn_container == simple):
                fqn_container = None
            (code_element, potentials) = self.field_linker.get_code_element(reference, field_elements, simple, fqn_container, log)
            if (code_element is not None):
                count += gl.save_link(reference, code_element, potentials, self)
        progress_monitor.work('Processing fields', 1)
    progress_monitor.done()
    log.close()
    progress_monitor.info('Processed fields')
    return count

dataset/ETHPy150Open bartdag/recodoc2/recodoc2/apps/codebase/linker/java_linkers.py JavaGenericLinker._process_tuples/original