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

项目:incubator-netbeans    文件:CasualDiff.java   
protected int diffAssert(JCAssert oldT, JCAssert newT, int[] bounds) {
    int localPointer = bounds[0];
    // cond
    int[] condBounds = getBounds(oldT.cond);
    copyTo(localPointer, condBounds[0]);
    localPointer = diffTree(oldT.cond, newT.cond, condBounds);
    // detail
    if (oldT.detail != newT.detail) {
        if (oldT.detail == null) {
            copyTo(localPointer, condBounds[1]);
            localPointer = condBounds[1];
            printer.print(" : ");
            printer.print(newT.detail);
        } else {
            int[] detailBounds = getBounds(oldT.detail);
            if (newT.detail == null) {
                copyTo(localPointer, condBounds[1]);
                localPointer = detailBounds[1];
            } else {
                copyTo(localPointer, detailBounds[0]);
                localPointer = diffTree(oldT.detail, newT.detail, detailBounds);
            }
        }
    }
    copyTo(localPointer, bounds[1]);

    return bounds[1];
}
项目:lombok-ianchiu    文件:PrettyPrinter.java   
@Override public void visitAssert(JCAssert tree) {
    aPrint("assert ");
    print(tree.cond);
    if (tree.detail != null) {
        print(" : ");
        print(tree.detail);
    }
    println(";", tree);
}
项目:javaparser2jctree    文件:PrintAstVisitor.java   
public void visitAssert(JCAssert that) {
    try {
        print("JCAssert:");
    } catch (Exception e) {
    }
    super.visitAssert(that);
}
项目:EasyMPermission    文件:PrettyCommentsPrinter.java   
public void visitAssert(JCAssert tree) {
    try {
        print("assert ");
        printExpr(tree.cond);
        if (tree.detail != null) {
            print(" : ");
            printExpr(tree.detail);
        }
        print(";");
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
}
项目:s4j    文件:Pretty.java   
public void visitAssert(JCAssert tree) {
    try {
        print("assert ");
        printExpr(tree.cond);
        if (tree.detail != null) {
            print(" : ");
            printExpr(tree.detail);
        }
        print(";");
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
}
项目:s4j    文件:Attr.java   
public void visitAssert(JCAssert tree) {
    attribExpr(tree.cond, env, syms.booleanType);
    if (tree.detail != null) {
        chk.checkNonVoid(tree.detail.pos(), attribExpr(tree.detail, env));
    }
    result = null;
}
项目:lombok    文件:PrettyCommentsPrinter.java   
public void visitAssert(JCAssert tree) {
    try {
        print("assert ");
        printExpr(tree.cond);
        if (tree.detail != null) {
            print(" : ");
            printExpr(tree.detail);
        }
        print(";");
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
}
项目:incubator-netbeans    文件:CasualDiff.java   
private boolean matchAssert(JCAssert t1, JCAssert t2) {
    return treesMatch(t1.cond, t2.cond) && treesMatch(t1.detail, t2.detail);
}
项目:lombok-ianchiu    文件:JavacTreeMaker.java   
public JCAssert Assert(JCExpression cond, JCExpression detail) {
    return invoke(Assert, cond, detail);
}
项目:javaparser2jctree    文件:AJCAssert.java   
public AJCAssert(JCAssert ltree) {
    super(ltree.cond, ltree.detail);
}
项目:javaparser2jctree    文件:AJCAssert.java   
public AJCAssert(JCAssert ltree, String lcomment) {
    this(ltree);
    setComment(lcomment);
}
项目:EasyMPermission    文件:JavacTreeMaker.java   
public JCAssert Assert(JCExpression cond, JCExpression detail) {
    return invoke(Assert, cond, detail);
}
项目:android-retrolambda-lombok    文件:JcTreePrinter.java   
@Override public void visitAssert(JCAssert tree) {
    printNode(tree);
    child("cond", tree.cond);
    child("detail", tree.detail);
    indent--;
}
项目:android-retrolambda-lombok    文件:JcTreeConverter.java   
@Override public void visitAssert(JCAssert node) {
    set(node, new Assert().rawAssertion(toTree(node.getCondition())).rawMessage(toTree(node.getDetail())));
}