

def _link_enumerations(self, enum_refs, ecount, progress_monitor):
    count = 0
    progress_monitor.start('Parsing enumerations', ecount)
    log = gl.LinkerLog(self, self.enum_kind.kind)
    for scode_reference in enum_refs:
        if self._reject_reference(scode_reference):
            progress_monitor.work('Skipped reference', 1)
            continue
        (simple, fqn) = je.get_class_name(scode_reference.content, (scode_reference.snippet is not None))
        if (simple is not None):
            prefix = '{0}{1}{2}'.format(PREFIX_ENUMERATION_LINKER, EXACT, cu.get_codebase_key(self.codebase))
            code_elements = cu.get_value(prefix, simple, gl.get_type_code_elements, [simple, self.codebase, self.enum_kind])
            (code_element, potentials) = self.get_code_element(scode_reference, code_elements, simple, fqn, log)
            count += gl.save_link(scode_reference, code_element, potentials, self)
            if (not log.custom_filtered):
                reclassify_java(code_element, scode_reference)
        progress_monitor.work('Processed enumeration', 1)
    log.close()
    progress_monitor.done()
    print('Associated {0} enumerations'.format(count))

dataset/ETHPy150Open bartdag/recodoc2/recodoc2/apps/codebase/linker/java_linkers.py JavaClassLinker._link_enumerations/original