def reclassify_java(code_element, scode_reference):
    reclassified = False

    if scode_reference.snippet is not None or code_element is not None:
        # We assume that references from snippet are always correctly
        # classified. References that were linked to a code element
        # do not need to be reclassified.
        return reclassified

    automatic_reclass = set(['method', 'field', 'annotation field',
        'enumeration value', 'annotation', 'enumeration'])
    unknown_kind = cu.get_value(PREFIX_UNKNOWN, UNKNOWN_KEY,
            gl.get_unknown_kind, None)

    if scode_reference.kind_hint.kind in automatic_reclass:
        scode_reference.kind_hint = unknown_kind
        reclassified = True
    elif scode_reference.child_references.count() == 0:
        # This was a single class reference, not mixed with a field or a
        # method (in which case, the field/method will be reclassified if
        # there is a need to). Maybe it was a reference to a method or a
        # field. The simple name will be compared with all code elements
        scode_reference.kind_hint = unknown_kind
        reclassified = True

    if reclassified:
        scode_reference.save()

    return reclassified
dataset/ETHPy150Open bartdag/recodoc2/recodoc2/apps/codebase/linker/java_linkers.py/reclassify_java/original