Java 类com.sun.tools.javac.tree.JCTree.JCUses 实例源码

项目:openjdk-jdk10    文件:Modules.java   
@Override
public void visitUses(JCUses tree) {
    Type st = attr.attribType(tree.qualid, env, syms.objectType);
    Symbol sym = TreeInfo.symbol(tree.qualid);
    if ((sym.flags() & ENUM) != 0) {
        log.error(tree.qualid.pos(), Errors.ServiceDefinitionIsEnum(st.tsym));
    } else if (st.hasTag(CLASS)) {
        ClassSymbol service = (ClassSymbol) st.tsym;
        if (allUses.add(service)) {
            Directive.UsesDirective d = new Directive.UsesDirective(service);
            msym.uses = msym.uses.prepend(d);
            msym.directives = msym.directives.prepend(d);
        } else {
            log.error(tree.pos(), Errors.DuplicateUses(service));
        }
    }
}
项目:openjdk9    文件:Modules.java   
@Override
public void visitUses(JCUses tree) {
    Type st = attr.attribType(tree.qualid, env, syms.objectType);
    Symbol sym = TreeInfo.symbol(tree.qualid);
    if ((sym.flags() & ENUM) != 0) {
        log.error(tree.qualid.pos(), Errors.ServiceDefinitionIsEnum(st.tsym));
    } else if (st.hasTag(CLASS)) {
        ClassSymbol service = (ClassSymbol) st.tsym;
        Directive.UsesDirective d = new Directive.UsesDirective(service);
        if (!allUses.add(d)) {
            log.error(tree.pos(), Errors.DuplicateUses(service));
        }
        msym.uses = msym.uses.prepend(d);
        msym.directives = msym.directives.prepend(d);
    }
}
项目:incubator-netbeans    文件:CasualDiff.java   
protected int diffUses(JCUses oldT, JCUses newT, int[] bounds) {
    int localPointer = bounds[0];
    // service
    int[] servBounds = getBounds(oldT.qualid);
    copyTo(localPointer, servBounds[0]);
    localPointer = diffTree(oldT.qualid, newT.qualid, servBounds);
    copyTo(localPointer, bounds[1]);

    return bounds[1];
}
项目:openjdk-jdk10    文件:Modules.java   
@Override
public void visitUses(JCUses tree) { }
项目:openjdk9    文件:Modules.java   
@Override
public void visitUses(JCUses tree) { }