

def _link_all_references(self, unknown_refs, ucount, progress_monitor):
    skipped = 0
    class_tuples = []
    progress_monitor.start('Parsing all unknown refs', ucount)
    for reference in unknown_refs:
        if self._reject_reference(reference):
            progress_monitor.work('Rejected reference.', 1)
            continue
        content = su.safe_strip(reference.content)
        if ((content is None) or (content == '')):
            progress_monitor.work('Empty {0}'.format(reference.pk), 1)
            skipped += 1
            continue
        (simple, fqn) = je.clean_java_name(je.get_clean_name(content))
        prefix = '{0}{1}'.format(PREFIX_GENERIC_LINKER, cu.get_codebase_key(self.codebase))
        if ((reference.source == 'd') or (reference.snippet is not None)):
            exact = True
            prefix += EXACT
        else:
            exact = False
            prefix += IEXACT
        code_elements = cu.get_value(prefix, simple, gl.get_any_code_element, [simple, self.codebase, exact])
        classified_elements = self._classify_code_elements(code_elements)
        class_tuples.append(((reference, simple, fqn) + classified_elements))
        progress_monitor.work('Classified reference', 1)
    progress_monitor.done()
    progress_monitor.info('Classified all refs. Processing now')
    count = self._process_tuples(class_tuples, progress_monitor)
    progress_monitor.info('Associated {0} elements, Skipped {1} elements'.format(count, skipped))
    progress_monitor.done()

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