PluginResolveContext.java 文件源码

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

项目:osc-core 作者:
/**
 * Get the repository index for the specified resource, where 0 indicates an
 * existing OSGi bundle in the framework and -1 indicates not found. This
 * method is used by
 * {@link #insertHostedCapability(List, HostedCapability)}.
 */
private int findResourceRepositoryIndex(Resource resource) {
    if (resource instanceof BundleRevision) {
        return 0;
    }

    int index = 1;
    Repository repo = this.resourceRepositoryMap.get(resource);
    if (repo == null) {
           return -1;
       }
    for (Repository match : this.repositories.values()) {
        if (repo == match) {
               return index;
           }
        index++;
    }
    // Still not found
    return -1;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号