• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Location类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sun.tools.classfile.Dependency.Location的典型用法代码示例。如果您正苦于以下问题:Java Location类的具体用法?Java Location怎么用?Java Location使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Location类属于com.sun.tools.classfile.Dependency包,在下文中一共展示了Location类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: visit

import com.sun.tools.classfile.Dependency.Location; //导入依赖的package包/类
@Override
public void visit(Location o, Location t) {
    Archive targetArchive = findArchive(t);
    if (filter.accepts(o, archive, t, targetArchive)) {
        addDep(o, t);
        if (!requires.contains(targetArchive)) {
            requires.add(targetArchive);
        }
    }
    if (targetArchive instanceof JDKArchive) {
        Profile p = Profile.getProfile(t.getPackageName());
        if (profile == null || (p != null && p.compareTo(profile) > 0)) {
            profile = p;
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:Analyzer.java


示例2: addDep

import com.sun.tools.classfile.Dependency.Location; //导入依赖的package包/类
protected Dep addDep(Location o, Location t) {
    String origin = getLocationName(o);
    String target = getLocationName(t);
    Archive targetArchive = findArchive(t);
    if (curDep != null &&
            curDep.origin().equals(origin) &&
            curDep.originArchive() == archive &&
            curDep.target().equals(target) &&
            curDep.targetArchive() == targetArchive) {
        return curDep;
    }

    Dep e = new Dep(origin, archive, target, targetArchive);
    if (deps.contains(e)) {
        for (Dep e1 : deps) {
            if (e.equals(e1)) {
                curDep = e1;
            }
        }
    } else {
        deps.add(e);
        curDep = e;
    }
    return curDep;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:Analyzer.java


示例3: transitiveArchiveDeps

import com.sun.tools.classfile.Dependency.Location; //导入依赖的package包/类
private void transitiveArchiveDeps(int depth) throws IOException {
    Stream<Location> deps = archives.stream()
                                    .flatMap(Archive::getDependencies);

    // start with the unresolved archives
    Set<Archive> unresolved = unresolvedArchives(deps);
    do {
        // parse all unresolved archives
        Set<Location> targets = apiOnly
            ? finder.parseExportedAPIs(unresolved.stream())
            : finder.parse(unresolved.stream());
        archives.addAll(unresolved);

        // Add dependencies to the next batch for analysis
        unresolved = unresolvedArchives(targets.stream());
    } while (!unresolved.isEmpty() && depth-- > 0);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:DepsAnalyzer.java


示例4: findArchive

import com.sun.tools.classfile.Dependency.Location; //导入依赖的package包/类
Archive findArchive(Location t) {
    // local in this archive
    if (archive.getClasses().contains(t))
        return archive;

    Archive target;
    if (locationToArchive.containsKey(t)) {
        target = locationToArchive.get(t);
    } else {
        // special case JDK removed API
        target = configuration.findClass(t)
            .orElseGet(() -> REMOVED_JDK_INTERNALS.contains(t)
                                ? REMOVED_JDK_INTERNALS
                                : NOT_FOUND);
    }
    return locationToArchive.computeIfAbsent(t, _k -> target);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:Analyzer.java


示例5: visit

import com.sun.tools.classfile.Dependency.Location; //导入依赖的package包/类
@Override
public void visit(Location o, Location t) {
    Archive targetArchive = findArchive(t);
    if (filter.accepts(o, archive, t, targetArchive)) {
        addDep(o, t);
        if (archive != targetArchive && !requires.contains(targetArchive)) {
            requires.add(targetArchive);
        }
    }
    if (targetArchive.getModule().isNamed()) {
        Profile p = Profile.getProfile(t.getPackageName());
        if (profile == null || (p != null && p.compareTo(profile) > 0)) {
            profile = p;
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:Analyzer.java


示例6: waitForTasksCompleted

import com.sun.tools.classfile.Dependency.Location; //导入依赖的package包/类
private Set<Location> waitForTasksCompleted() {
    try {
        Set<Location> targets = new HashSet<>();
        FutureTask<Set<Location>> task;
        while ((task = tasks.poll()) != null) {
            // wait for completion
            if (!task.isDone())
                targets.addAll(task.get());
        }
        return targets;
    } catch (InterruptedException|ExecutionException e) {
        throw new Error(e);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:DependencyFinder.java


示例7: visit

import com.sun.tools.classfile.Dependency.Location; //导入依赖的package包/类
@Override
public void visit(Location o, Location t) {
    Archive targetArchive = findArchive(t);
    if (filter.accepts(o, archive, t, targetArchive)) {
        addDep(o, t);
        if (archive != targetArchive && !requires.contains(targetArchive)) {
            requires.add(targetArchive);
        }
    }
    if (targetArchive instanceof JDKArchive) {
        Profile p = Profile.getProfile(t.getPackageName());
        if (profile == null || (p != null && p.compareTo(profile) > 0)) {
            profile = p;
        }
    }
}
 
开发者ID:ojdkbuild,项目名称:lookaside_java-1.8.0-openjdk,代码行数:17,代码来源:Analyzer.java


示例8: addClass

import com.sun.tools.classfile.Dependency.Location; //导入依赖的package包/类
public void addClass(Location origin) {
    Set<Location> set = deps.get(origin);
    if (set == null) {
        set = new HashSet<>();
        deps.put(origin, set);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:Archive.java


示例9: visitDependences

import com.sun.tools.classfile.Dependency.Location; //导入依赖的package包/类
public void visitDependences(Visitor v) {
    for (Map.Entry<Location,Set<Location>> e: deps.entrySet()) {
        for (Location target : e.getValue()) {
            v.visit(e.getKey(), target);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:Archive.java


示例10: run

import com.sun.tools.classfile.Dependency.Location; //导入依赖的package包/类
private boolean run() throws IOException {
    // parse classfiles and find all dependencies
    findDependencies();

    Analyzer analyzer = new Analyzer(options.verbose, new Analyzer.Filter() {
        @Override
        public boolean accepts(Location origin, Archive originArchive,
                               Location target, Archive targetArchive)
        {
            if (options.findJDKInternals) {
                // accepts target that is JDK class but not exported
                return isJDKArchive(targetArchive) &&
                          !((JDKArchive) targetArchive).isExported(target.getClassName());
            } else if (options.filterSameArchive) {
                // accepts origin and target that from different archive
                return originArchive != targetArchive;
            }
            return true;
        }
    });

    // analyze the dependencies
    analyzer.run(sourceLocations);

    // output result
    if (options.dotOutputDir != null) {
        Path dir = Paths.get(options.dotOutputDir);
        Files.createDirectories(dir);
        generateDotFiles(dir, analyzer);
    } else {
        printRawOutput(log, analyzer);
    }

    if (options.findJDKInternals && !options.nowarning) {
        showReplacements(analyzer);
    }
    return true;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:39,代码来源:JdepsTask.java


示例11: buildLocationArchiveMap

import com.sun.tools.classfile.Dependency.Location; //导入依赖的package包/类
private void buildLocationArchiveMap(List<Archive> archives) {
    // build a map from Location to Archive
    for (Archive archive: archives) {
        for (Location l: archive.getClasses()) {
            if (!map.containsKey(l)) {
                map.put(l, archive);
            } else {
                // duplicated class warning?
            }
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:Analyzer.java


示例12: findArchive

import com.sun.tools.classfile.Dependency.Location; //导入依赖的package包/类
Archive findArchive(Location t) {
    Archive target = archive.getClasses().contains(t) ? archive : map.get(t);
    if (target == null) {
        map.put(t, target = NOT_FOUND);
    }
    return target;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:Analyzer.java


示例13: getLocationName

import com.sun.tools.classfile.Dependency.Location; //导入依赖的package包/类
private String getLocationName(Location o) {
    if (level == Type.CLASS || level == Type.VERBOSE) {
        return o.getClassName();
    } else {
        String pkg = o.getPackageName();
        return pkg.isEmpty() ? "<unnamed>" : pkg;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:Analyzer.java


示例14: unresolvedArchives

import com.sun.tools.classfile.Dependency.Location; //导入依赖的package包/类
/**
 * Returns the archives that contains the given locations and
 * not parsed and analyzed.
 */
private Set<Archive> unresolvedArchives(Stream<Location> locations) {
    return locations.filter(l -> !finder.isParsed(l))
                    .distinct()
                    .map(configuration::findClass)
                    .flatMap(Optional::stream)
                    .collect(toSet());
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:DepsAnalyzer.java


示例15: transitiveDeps

import com.sun.tools.classfile.Dependency.Location; //导入依赖的package包/类
private void transitiveDeps(int depth) throws IOException {
    Stream<Location> deps = archives.stream()
                                    .flatMap(Archive::getDependencies);

    Deque<Location> unresolved = deps.collect(Collectors.toCollection(LinkedList::new));
    ConcurrentLinkedDeque<Location> deque = new ConcurrentLinkedDeque<>();
    do {
        Location target;
        while ((target = unresolved.poll()) != null) {
            if (finder.isParsed(target))
                continue;

            Archive archive = configuration.findClass(target).orElse(null);
            if (archive != null) {
                archives.add(archive);

                String name = target.getName();
                Set<Location> targets = apiOnly
                        ? finder.parseExportedAPIs(archive, name)
                        : finder.parse(archive, name);

                // build unresolved dependencies
                targets.stream()
                       .filter(t -> !finder.isParsed(t))
                       .forEach(deque::add);
            }
        }
        unresolved = deque;
        deque = new ConcurrentLinkedDeque<>();
    } while (!unresolved.isEmpty() && depth-- > 0);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:32,代码来源:DepsAnalyzer.java


示例16: run

import com.sun.tools.classfile.Dependency.Location; //导入依赖的package包/类
/**
 * Performs the dependency analysis on the given archives.
 */
boolean run(Iterable<? extends Archive> archives,
            Map<Location, Archive> locationMap)
{
    this.locationToArchive.putAll(locationMap);

    // traverse and analyze all dependencies
    for (Archive archive : archives) {
        Dependences deps = new Dependences(archive, type);
        archive.visitDependences(deps);
        results.put(archive, deps);
    }
    return true;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:Analyzer.java


示例17: getLocationName

import com.sun.tools.classfile.Dependency.Location; //导入依赖的package包/类
private String getLocationName(Location o) {
    if (level == Type.CLASS || level == Type.VERBOSE) {
        return VersionHelper.get(o.getClassName());
    } else {
        String pkg = o.getPackageName();
        return pkg.isEmpty() ? "<unnamed>" : pkg;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:Analyzer.java


示例18: contains

import com.sun.tools.classfile.Dependency.Location; //导入依赖的package包/类
public boolean contains(Location location) {
    String cn = location.getClassName();
    int i = cn.lastIndexOf('.');
    String pn = i > 0 ? cn.substring(0, i) : "";

    return jdk8Internals.contains(pn);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:Analyzer.java


示例19: parse

import com.sun.tools.classfile.Dependency.Location; //导入依赖的package包/类
/**
 * Parses the named class from the given archive and
 * returns all target locations the named class references.
 */
public Set<Location> parse(Archive archive, String name) {
    try {
        return parse(archive, CLASS_FINDER, name);
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:DependencyFinder.java


示例20: parseExportedAPIs

import com.sun.tools.classfile.Dependency.Location; //导入依赖的package包/类
/**
 * Parses the exported API of the named class from the given archive and
 * returns all target locations the named class references.
 */
public Set<Location> parseExportedAPIs(Archive archive, String name)
{
    try {
        return parse(archive, API_FINDER, name);
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:DependencyFinder.java



注:本文中的com.sun.tools.classfile.Dependency.Location类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ScreenUtils类代码示例发布时间:2022-05-21
下一篇:
Java CodePointIterator类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap