def _sorted_unique_jdk_configs(configs):
path_seen = set()
unique_configs = [c for c in configs if c.home not in path_seen and not path_seen.add(c.home)]
def _compare_configs(c1, c2):
if c1 == _default_java_home:
if c2 != _default_java_home:
return 1
elif c2 == _default_java_home:
return -1
if c1 in _extra_java_homes:
if c2 not in _extra_java_homes:
return 1
elif c2 in _extra_java_homes:
return -1
return VersionSpec.__cmp__(c1.version, c2.version)
return sorted(unique_configs, cmp=_compare_configs, reverse=True)
评论列表
文章目录