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

项目:incubator-netbeans    文件:CasualDiff.java   
protected int diffSynchronized(JCSynchronized oldT, JCSynchronized newT, int[] bounds) {
    int localPointer = bounds[0];
    // lock
    int[] lockBounds = getBounds(oldT.lock);
    copyTo(localPointer, lockBounds[0]);
    localPointer = diffTree(oldT.lock, newT.lock, lockBounds);
    // body
    int[] bodyBounds = getBounds(oldT.body);
    copyTo(localPointer, bodyBounds[0]);
    int oldIndent = newT.body.hasTag(Tag.BLOCK) ? -1 : printer.indent();
    localPointer = diffTree(oldT.body, newT.body, bodyBounds);
    if (!newT.body.hasTag(Tag.BLOCK))
        printer.undent(oldIndent);
    copyTo(localPointer, bounds[1]);

    return bounds[1];
}
项目:EasyMPermission    文件:PrettyCommentsPrinter.java   
public void visitSynchronized(JCSynchronized tree) {
    try {
        print("synchronized ");
        if (PARENS.equals(treeTag(tree.lock))) {
            printExpr(tree.lock);
        } else {
            print("(");
            printExpr(tree.lock);
            print(")");
        }
        print(" ");
        printStat(tree.body);
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
}
项目:s4j    文件:Pretty.java   
public void visitSynchronized(JCSynchronized tree) {
    try {
        print("synchronized ");
        if (tree.lock.getTag() == JCTree.PARENS) {
            printExpr(tree.lock);
        } else {
            print("(");
            printExpr(tree.lock);
            print(")");
        }
        print(" ");
        printStat(tree.body);
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
}
项目:lombok    文件:PrettyCommentsPrinter.java   
public void visitSynchronized(JCSynchronized tree) {
    try {
        print("synchronized ");
        if (getTag(tree.lock) == PARENS) {
            printExpr(tree.lock);
        } else {
            print("(");
            printExpr(tree.lock);
            print(")");
        }
        print(" ");
        printStat(tree.body);
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
}
项目:lombok-ianchiu    文件:PrettyPrinter.java   
@Override public void visitSynchronized(JCSynchronized tree) {
    aPrint("synchronized ");
    if (tree.lock instanceof JCParens) {
        print(tree.lock);
    } else {
        print("(");
        print(tree.lock);
        print(")");
    }
    print(" ");
    print(tree.body);
}
项目:javaparser2jctree    文件:PrintAstVisitor.java   
public void visitSynchronized(JCSynchronized that) {
    try {
        print("JCSynchronized:");
    } catch (Exception e) {
    }
    super.visitSynchronized(that);
}
项目:error-prone    文件:PlaceholderUnificationVisitor.java   
@Override
public Choice<State<JCSynchronized>> visitSynchronized(
    final SynchronizedTree node, State<?> state) {
  return chooseSubtrees(
      state,
      s -> unifyExpression(node.getExpression(), s),
      s -> unifyStatement(node.getBlock(), s),
      (expr, block) -> maker().Synchronized(expr, (JCBlock) block));
}
项目:incubator-netbeans    文件:CasualDiff.java   
private boolean matchSynchronized(JCSynchronized t1, JCSynchronized t2) {
    return treesMatch(t1.lock, t2.lock) && treesMatch(t1.body, t2.body);
}
项目:lombok-ianchiu    文件:JavacTreeMaker.java   
public JCSynchronized Synchronized(JCExpression lock, JCBlock body) {
    return invoke(Synchronized, lock, body);
}
项目:javaparser2jctree    文件:AJCSynchronized.java   
public AJCSynchronized(JCSynchronized ltree) {
    super(ltree.lock, ltree.body);
}
项目:javaparser2jctree    文件:AJCSynchronized.java   
public AJCSynchronized(JCSynchronized ltree, String lcomment) {
    this(ltree);
    setComment(lcomment);
}
项目:EasyMPermission    文件:JavacTreeMaker.java   
public JCSynchronized Synchronized(JCExpression lock, JCBlock body) {
    return invoke(Synchronized, lock, body);
}
项目:refactor-faster    文件:USynchronized.java   
@Override
public JCSynchronized inline(Inliner inliner) throws CouldNotResolveImportException {
  return inliner.maker().Synchronized(
      getExpression().inline(inliner), getBlock().inline(inliner));
}
项目:android-retrolambda-lombok    文件:JcTreePrinter.java   
@Override public void visitSynchronized(JCSynchronized tree) {
    printNode(tree);
    child("lock", tree.lock);
    child("body", tree.body);
    indent--;
}
项目:android-retrolambda-lombok    文件:JcTreeConverter.java   
@Override public void visitSynchronized(JCSynchronized node) {
    Synchronized s = new Synchronized();
    JCExpression cond = node.getExpression();
    setConversionPositionInfo(s, "()", getPosition(cond));
    set(node, s.rawLock(toTree(removeParens(cond))).rawBody(toTree(node.getBlock())));
}
项目:error-prone    文件:USynchronized.java   
@Override
public JCSynchronized inline(Inliner inliner) throws CouldNotResolveImportException {
  return inliner
      .maker()
      .Synchronized(getExpression().inline(inliner), getBlock().inline(inliner));
}
项目:s4j    文件:Attr.java   
public void visitSynchronized(JCSynchronized tree) {
    chk.checkRefType(tree.pos(), attribExpr(tree.lock, env));
    attribStat(tree.body, env);
    result = null;
}
项目:Refaster    文件:USynchronized.java   
@Override
public JCSynchronized inline(Inliner inliner) throws CouldNotResolveImportException {
  return inliner.maker().Synchronized(
      getExpression().inline(inliner), getBlock().inline(inliner));
}