ResolvedFeatures.java 文件源码

java
阅读 42 收藏 0 点赞 0 评论 0

项目:xtext-extras 作者:
protected List<IResolvedOperation> computeAllOperations() {
    JvmType rawType = getRawType();
    if (!(rawType instanceof JvmDeclaredType)) {
        return Collections.emptyList();
    }
    Multimap<String, AbstractResolvedOperation> processedOperations = LinkedHashMultimap.create();
    for (IResolvedOperation resolvedOperation : getDeclaredOperations()) {
        processedOperations.put(resolvedOperation.getDeclaration().getSimpleName(), (AbstractResolvedOperation) resolvedOperation);
    }
    if (targetVersion.isAtLeast(JavaVersion.JAVA8)) {
        computeAllOperationsFromSortedSuperTypes((JvmDeclaredType) rawType, processedOperations);
    } else {
        Set<JvmType> processedTypes = Sets.newHashSet(rawType);
        computeAllOperationsFromSuperTypes((JvmDeclaredType) rawType, processedOperations, processedTypes);
    }
    // make sure the declared operations are the first in the list
    List<IResolvedOperation> result = new ArrayList<IResolvedOperation>(processedOperations.size());
    result.addAll(getDeclaredOperations());
    for (AbstractResolvedOperation operation : processedOperations.values()) {
        if (operation.getDeclaration().getDeclaringType() != rawType) {
            result.add(operation);
        }
    }
    return Collections.unmodifiableList(result);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号