Java 类com.sun.org.apache.bcel.internal.generic.NEW 实例源码

项目:SpringBoot_Wechat_Sell    文件:OrderServiceImpl.java   
@Override
@Transactional
public OrderDTO finish(OrderDTO orderDTO) {

    if (!orderDTO.getOrderStatus().equals(OrderStatusEnum.NEW.getCode())) {
        log.error("【取消订单操作】 订单状态不正确 orderId={},orderStats={}", orderDTO.getOrderId(), orderDTO.getOrderStatus());
        throw new SellException(ResultEnum.ORDER_STATUS_ERROR);
    }

    orderDTO.setOrderStatus(OrderStatusEnum.FINISHED.getCode());
    OrderMaster orderMaster = new OrderMaster();
    BeanUtils.copyProperties(orderDTO, orderMaster);

    OrderMaster updateResult = orderMasterRepository.save(orderMaster);

    if (updateResult == null) {
        log.error("取消完结失败,orderMaster={}", orderMaster);
        throw new SellException(ResultEnum.ORDER_UPDATE_FAIL);
    }

    pushMessageService.orderStatus(orderDTO);
    return orderDTO;
}
项目:SpringBoot_Wechat_Sell    文件:OrderServiceImpl.java   
@Override
@Transactional
public OrderDTO cancel(OrderDTO orderDTO) {
    OrderMaster orderMaster = new OrderMaster();


    if (!orderDTO.getOrderStatus().equals(OrderStatusEnum.NEW.getCode())) {
        log.error("【取消订单操作】 订单状态不正确 orderId={},orderStats={}", orderDTO.getOrderId(), orderDTO.getOrderStatus());
        throw new SellException(ResultEnum.ORDER_STATUS_ERROR);
    }
    orderDTO.setOrderStatus(OrderStatusEnum.CANCEL.getCode());
    BeanUtils.copyProperties(orderDTO, orderMaster);
    OrderMaster updateResult = orderMasterRepository.save(orderMaster);

    if (updateResult == null) {
        log.error("取消订单失败,orderMaster={}", orderMaster);
        throw new SellException(ResultEnum.ORDER_UPDATE_FAIL);
    }

    //返回库存
    if (CollectionUtils.isEmpty(orderDTO.getOrderDetailList())) {
        log.error("【取消订单】订单中无商品详情, orderDTO={}", orderDTO);
        throw new SellException(ResultEnum.ORDER_DETAIL_EMPTY);
    }

    List<CartDTO> cartDTOList = orderDTO.getOrderDetailList().stream().map(e ->
            new CartDTO(e.getProductId(), e.getProductQuantity())
    ).collect(Collectors.toList());

    productService.increaseStock(cartDTOList);

    //支付成功退款
    if (orderDTO.getPayStatus().equals(PayStatusEnum.SUCCESS)) {
        payService.refund(orderDTO);
    }
    return orderDTO;
}
项目:SpringBoot_Wechat_Sell    文件:OrderServiceImpl.java   
@Override
@Transactional
public OrderDTO paid(OrderDTO orderDTO) {


    if (!orderDTO.getOrderStatus().equals(OrderStatusEnum.NEW.getCode())) {
        log.error("【支付订单操作】 订单状态不正确 orderId={},orderStats={}", orderDTO.getOrderId(), orderDTO.getOrderStatus());
        throw new SellException(ResultEnum.ORDER_STATUS_ERROR);
    }


    if (!orderDTO.getPayStatus().equals(PayStatusEnum.WAIT.getCode())) {
        log.error("【支付订单操作】 订单支付状态不正确 orderId={},orderStats={}", orderDTO.getOrderId(), orderDTO.getOrderStatus());
        throw new SellException(ResultEnum.ORDER_PAY_STATUS_ERROR);
    }

    //修改支付状态
    orderDTO.setPayStatus(PayStatusEnum.SUCCESS.getCode());
    OrderMaster orderMaster = new OrderMaster();
    BeanUtils.copyProperties(orderDTO, orderMaster);

    OrderMaster updateResult = orderMasterRepository.save(orderMaster);

    if (updateResult == null) {
        log.error("支付订单失败,orderMaster={}", orderMaster);
        throw new SellException(ResultEnum.ORDER_UPDATE_FAIL);
    }
    return orderDTO;
}
项目:OpenJSharp    文件:UnionPathExpr.java   
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();

    final int init = cpg.addMethodref(UNION_ITERATOR_CLASS,
                                      "<init>",
                                      "("+DOM_INTF_SIG+")V");
    final int iter = cpg.addMethodref(UNION_ITERATOR_CLASS,
                                      ADD_ITERATOR,
                                      ADD_ITERATOR_SIG);

    // Create the UnionIterator and leave it on the stack
    il.append(new NEW(cpg.addClass(UNION_ITERATOR_CLASS)));
    il.append(DUP);
    il.append(methodGen.loadDOM());
    il.append(new INVOKESPECIAL(init));

    // Add the various iterators to the UnionIterator
    final int length = _components.length;
    for (int i = 0; i < length; i++) {
        _components[i].translate(classGen, methodGen);
        il.append(new INVOKEVIRTUAL(iter));
    }

    // Order the iterator only if strictly needed
    if (_reverse) {
        final int order = cpg.addInterfaceMethodref(DOM_INTF,
                                                    ORDER_ITERATOR,
                                                    ORDER_ITERATOR_SIG);
        il.append(methodGen.loadDOM());
        il.append(SWAP);
        il.append(methodGen.loadContextNode());
        il.append(new INVOKEINTERFACE(order, 3));

    }
}
项目:OpenJSharp    文件:IntType.java   
/**
 * Expects an integer on the stack and pushes a boxed integer.
 * Boxed integers are represented by an instance of
 * <code>java.lang.Integer</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(INTEGER_CLASS)));
    il.append(DUP_X1);
    il.append(SWAP);
    il.append(new INVOKESPECIAL(cpg.addMethodref(INTEGER_CLASS,
                                                 "<init>", "(I)V")));
}
项目:OpenJSharp    文件:RealType.java   
/**
 * Expects a double on the stack and pushes a boxed double. Boxed
 * double are represented by an instance of <code>java.lang.Double</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(DOUBLE_CLASS)));
    il.append(DUP_X2);
    il.append(DUP_X2);
    il.append(POP);
    il.append(new INVOKESPECIAL(cpg.addMethodref(DOUBLE_CLASS,
                                                 "<init>", "(D)V")));
}
项目:OpenJSharp    文件:BooleanType.java   
/**
 * Expects a boolean on the stack and pushes a boxed boolean.
 * Boxed booleans are represented by an instance of
 * <code>java.lang.Boolean</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(BOOLEAN_CLASS)));
    il.append(DUP_X1);
    il.append(SWAP);
    il.append(new INVOKESPECIAL(cpg.addMethodref(BOOLEAN_CLASS,
                                                 "<init>",
                                                 "(Z)V")));
}
项目:OpenJSharp    文件:NodeType.java   
/**
 * Expects a node on the stack and pushes a singleton node-set. Singleton
 * iterators are already started after construction.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        NodeSetType type) {
    ConstantPoolGen cpg = classGen.getConstantPool();
    InstructionList il = methodGen.getInstructionList();

    // Create a new instance of SingletonIterator
    il.append(new NEW(cpg.addClass(SINGLETON_ITERATOR)));
    il.append(DUP_X1);
    il.append(SWAP);
    final int init = cpg.addMethodref(SINGLETON_ITERATOR, "<init>",
                                      "(" + NODE_SIG +")V");
    il.append(new INVOKESPECIAL(init));
}
项目:OpenJSharp    文件:NodeType.java   
/**
 * Expects a node on the stack and pushes a boxed node. Boxed nodes
 * are represented by an instance of <code>com.sun.org.apache.xalan.internal.xsltc.dom.Node</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(RUNTIME_NODE_CLASS)));
    il.append(DUP_X1);
    il.append(SWAP);
    il.append(new PUSH(cpg, _type));
    il.append(new INVOKESPECIAL(cpg.addMethodref(RUNTIME_NODE_CLASS,
                                                 "<init>", "(II)V")));
}
项目:openjdk-jdk10    文件:UnionPathExpr.java   
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();

    final int init = cpg.addMethodref(UNION_ITERATOR_CLASS,
                                      "<init>",
                                      "("+DOM_INTF_SIG+")V");
    final int iter = cpg.addMethodref(UNION_ITERATOR_CLASS,
                                      ADD_ITERATOR,
                                      ADD_ITERATOR_SIG);

    // Create the UnionIterator and leave it on the stack
    il.append(new NEW(cpg.addClass(UNION_ITERATOR_CLASS)));
    il.append(DUP);
    il.append(methodGen.loadDOM());
    il.append(new INVOKESPECIAL(init));

    // Add the various iterators to the UnionIterator
    final int length = _components.length;
    for (int i = 0; i < length; i++) {
        _components[i].translate(classGen, methodGen);
        il.append(new INVOKEVIRTUAL(iter));
    }

    // Order the iterator only if strictly needed
    if (_reverse) {
        final int order = cpg.addInterfaceMethodref(DOM_INTF,
                                                    ORDER_ITERATOR,
                                                    ORDER_ITERATOR_SIG);
        il.append(methodGen.loadDOM());
        il.append(SWAP);
        il.append(methodGen.loadContextNode());
        il.append(new INVOKEINTERFACE(order, 3));

    }
}
项目:openjdk-jdk10    文件:IntType.java   
/**
 * Expects an integer on the stack and pushes a boxed integer.
 * Boxed integers are represented by an instance of
 * <code>java.lang.Integer</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(INTEGER_CLASS)));
    il.append(DUP_X1);
    il.append(SWAP);
    il.append(new INVOKESPECIAL(cpg.addMethodref(INTEGER_CLASS,
                                                 "<init>", "(I)V")));
}
项目:openjdk-jdk10    文件:RealType.java   
/**
 * Expects a double on the stack and pushes a boxed double. Boxed
 * double are represented by an instance of <code>java.lang.Double</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(DOUBLE_CLASS)));
    il.append(DUP_X2);
    il.append(DUP_X2);
    il.append(POP);
    il.append(new INVOKESPECIAL(cpg.addMethodref(DOUBLE_CLASS,
                                                 "<init>", "(D)V")));
}
项目:openjdk-jdk10    文件:BooleanType.java   
/**
 * Expects a boolean on the stack and pushes a boxed boolean.
 * Boxed booleans are represented by an instance of
 * <code>java.lang.Boolean</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(BOOLEAN_CLASS)));
    il.append(DUP_X1);
    il.append(SWAP);
    il.append(new INVOKESPECIAL(cpg.addMethodref(BOOLEAN_CLASS,
                                                 "<init>",
                                                 "(Z)V")));
}
项目:openjdk-jdk10    文件:NodeType.java   
/**
 * Expects a node on the stack and pushes a singleton node-set. Singleton
 * iterators are already started after construction.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        NodeSetType type) {
    ConstantPoolGen cpg = classGen.getConstantPool();
    InstructionList il = methodGen.getInstructionList();

    // Create a new instance of SingletonIterator
    il.append(new NEW(cpg.addClass(SINGLETON_ITERATOR)));
    il.append(DUP_X1);
    il.append(SWAP);
    final int init = cpg.addMethodref(SINGLETON_ITERATOR, "<init>",
                                      "(" + NODE_SIG +")V");
    il.append(new INVOKESPECIAL(init));
}
项目:openjdk-jdk10    文件:NodeType.java   
/**
 * Expects a node on the stack and pushes a boxed node. Boxed nodes
 * are represented by an instance of <code>com.sun.org.apache.xalan.internal.xsltc.dom.Node</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(RUNTIME_NODE_CLASS)));
    il.append(DUP_X1);
    il.append(SWAP);
    il.append(new PUSH(cpg, _type));
    il.append(new INVOKESPECIAL(cpg.addMethodref(RUNTIME_NODE_CLASS,
                                                 "<init>", "(II)V")));
}
项目:openjdk9    文件:UnionPathExpr.java   
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();

    final int init = cpg.addMethodref(UNION_ITERATOR_CLASS,
                                      "<init>",
                                      "("+DOM_INTF_SIG+")V");
    final int iter = cpg.addMethodref(UNION_ITERATOR_CLASS,
                                      ADD_ITERATOR,
                                      ADD_ITERATOR_SIG);

    // Create the UnionIterator and leave it on the stack
    il.append(new NEW(cpg.addClass(UNION_ITERATOR_CLASS)));
    il.append(DUP);
    il.append(methodGen.loadDOM());
    il.append(new INVOKESPECIAL(init));

    // Add the various iterators to the UnionIterator
    final int length = _components.length;
    for (int i = 0; i < length; i++) {
        _components[i].translate(classGen, methodGen);
        il.append(new INVOKEVIRTUAL(iter));
    }

    // Order the iterator only if strictly needed
    if (_reverse) {
        final int order = cpg.addInterfaceMethodref(DOM_INTF,
                                                    ORDER_ITERATOR,
                                                    ORDER_ITERATOR_SIG);
        il.append(methodGen.loadDOM());
        il.append(SWAP);
        il.append(methodGen.loadContextNode());
        il.append(new INVOKEINTERFACE(order, 3));

    }
}
项目:openjdk9    文件:IntType.java   
/**
 * Expects an integer on the stack and pushes a boxed integer.
 * Boxed integers are represented by an instance of
 * <code>java.lang.Integer</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(INTEGER_CLASS)));
    il.append(DUP_X1);
    il.append(SWAP);
    il.append(new INVOKESPECIAL(cpg.addMethodref(INTEGER_CLASS,
                                                 "<init>", "(I)V")));
}
项目:openjdk9    文件:RealType.java   
/**
 * Expects a double on the stack and pushes a boxed double. Boxed
 * double are represented by an instance of <code>java.lang.Double</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(DOUBLE_CLASS)));
    il.append(DUP_X2);
    il.append(DUP_X2);
    il.append(POP);
    il.append(new INVOKESPECIAL(cpg.addMethodref(DOUBLE_CLASS,
                                                 "<init>", "(D)V")));
}
项目:openjdk9    文件:BooleanType.java   
/**
 * Expects a boolean on the stack and pushes a boxed boolean.
 * Boxed booleans are represented by an instance of
 * <code>java.lang.Boolean</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(BOOLEAN_CLASS)));
    il.append(DUP_X1);
    il.append(SWAP);
    il.append(new INVOKESPECIAL(cpg.addMethodref(BOOLEAN_CLASS,
                                                 "<init>",
                                                 "(Z)V")));
}
项目:openjdk9    文件:NodeType.java   
/**
 * Expects a node on the stack and pushes a singleton node-set. Singleton
 * iterators are already started after construction.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        NodeSetType type) {
    ConstantPoolGen cpg = classGen.getConstantPool();
    InstructionList il = methodGen.getInstructionList();

    // Create a new instance of SingletonIterator
    il.append(new NEW(cpg.addClass(SINGLETON_ITERATOR)));
    il.append(DUP_X1);
    il.append(SWAP);
    final int init = cpg.addMethodref(SINGLETON_ITERATOR, "<init>",
                                      "(" + NODE_SIG +")V");
    il.append(new INVOKESPECIAL(init));
}
项目:openjdk9    文件:NodeType.java   
/**
 * Expects a node on the stack and pushes a boxed node. Boxed nodes
 * are represented by an instance of <code>com.sun.org.apache.xalan.internal.xsltc.dom.Node</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(RUNTIME_NODE_CLASS)));
    il.append(DUP_X1);
    il.append(SWAP);
    il.append(new PUSH(cpg, _type));
    il.append(new INVOKESPECIAL(cpg.addMethodref(RUNTIME_NODE_CLASS,
                                                 "<init>", "(II)V")));
}
项目:lookaside_java-1.8.0-openjdk    文件:UnionPathExpr.java   
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();

    final int init = cpg.addMethodref(UNION_ITERATOR_CLASS,
                                      "<init>",
                                      "("+DOM_INTF_SIG+")V");
    final int iter = cpg.addMethodref(UNION_ITERATOR_CLASS,
                                      ADD_ITERATOR,
                                      ADD_ITERATOR_SIG);

    // Create the UnionIterator and leave it on the stack
    il.append(new NEW(cpg.addClass(UNION_ITERATOR_CLASS)));
    il.append(DUP);
    il.append(methodGen.loadDOM());
    il.append(new INVOKESPECIAL(init));

    // Add the various iterators to the UnionIterator
    final int length = _components.length;
    for (int i = 0; i < length; i++) {
        _components[i].translate(classGen, methodGen);
        il.append(new INVOKEVIRTUAL(iter));
    }

    // Order the iterator only if strictly needed
    if (_reverse) {
        final int order = cpg.addInterfaceMethodref(DOM_INTF,
                                                    ORDER_ITERATOR,
                                                    ORDER_ITERATOR_SIG);
        il.append(methodGen.loadDOM());
        il.append(SWAP);
        il.append(methodGen.loadContextNode());
        il.append(new INVOKEINTERFACE(order, 3));

    }
}
项目:lookaside_java-1.8.0-openjdk    文件:IntType.java   
/**
 * Expects an integer on the stack and pushes a boxed integer.
 * Boxed integers are represented by an instance of
 * <code>java.lang.Integer</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(INTEGER_CLASS)));
    il.append(DUP_X1);
    il.append(SWAP);
    il.append(new INVOKESPECIAL(cpg.addMethodref(INTEGER_CLASS,
                                                 "<init>", "(I)V")));
}
项目:lookaside_java-1.8.0-openjdk    文件:RealType.java   
/**
 * Expects a double on the stack and pushes a boxed double. Boxed
 * double are represented by an instance of <code>java.lang.Double</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(DOUBLE_CLASS)));
    il.append(DUP_X2);
    il.append(DUP_X2);
    il.append(POP);
    il.append(new INVOKESPECIAL(cpg.addMethodref(DOUBLE_CLASS,
                                                 "<init>", "(D)V")));
}
项目:lookaside_java-1.8.0-openjdk    文件:BooleanType.java   
/**
 * Expects a boolean on the stack and pushes a boxed boolean.
 * Boxed booleans are represented by an instance of
 * <code>java.lang.Boolean</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(BOOLEAN_CLASS)));
    il.append(DUP_X1);
    il.append(SWAP);
    il.append(new INVOKESPECIAL(cpg.addMethodref(BOOLEAN_CLASS,
                                                 "<init>",
                                                 "(Z)V")));
}
项目:lookaside_java-1.8.0-openjdk    文件:NodeType.java   
/**
 * Expects a node on the stack and pushes a singleton node-set. Singleton
 * iterators are already started after construction.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        NodeSetType type) {
    ConstantPoolGen cpg = classGen.getConstantPool();
    InstructionList il = methodGen.getInstructionList();

    // Create a new instance of SingletonIterator
    il.append(new NEW(cpg.addClass(SINGLETON_ITERATOR)));
    il.append(DUP_X1);
    il.append(SWAP);
    final int init = cpg.addMethodref(SINGLETON_ITERATOR, "<init>",
                                      "(" + NODE_SIG +")V");
    il.append(new INVOKESPECIAL(init));
}
项目:lookaside_java-1.8.0-openjdk    文件:NodeType.java   
/**
 * Expects a node on the stack and pushes a boxed node. Boxed nodes
 * are represented by an instance of <code>com.sun.org.apache.xalan.internal.xsltc.dom.Node</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(RUNTIME_NODE_CLASS)));
    il.append(DUP_X1);
    il.append(SWAP);
    il.append(new PUSH(cpg, _type));
    il.append(new INVOKESPECIAL(cpg.addMethodref(RUNTIME_NODE_CLASS,
                                                 "<init>", "(II)V")));
}
项目:infobip-open-jdk-8    文件:UnionPathExpr.java   
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();

    final int init = cpg.addMethodref(UNION_ITERATOR_CLASS,
                                      "<init>",
                                      "("+DOM_INTF_SIG+")V");
    final int iter = cpg.addMethodref(UNION_ITERATOR_CLASS,
                                      ADD_ITERATOR,
                                      ADD_ITERATOR_SIG);

    // Create the UnionIterator and leave it on the stack
    il.append(new NEW(cpg.addClass(UNION_ITERATOR_CLASS)));
    il.append(DUP);
    il.append(methodGen.loadDOM());
    il.append(new INVOKESPECIAL(init));

    // Add the various iterators to the UnionIterator
    final int length = _components.length;
    for (int i = 0; i < length; i++) {
        _components[i].translate(classGen, methodGen);
        il.append(new INVOKEVIRTUAL(iter));
    }

    // Order the iterator only if strictly needed
    if (_reverse) {
        final int order = cpg.addInterfaceMethodref(DOM_INTF,
                                                    ORDER_ITERATOR,
                                                    ORDER_ITERATOR_SIG);
        il.append(methodGen.loadDOM());
        il.append(SWAP);
        il.append(methodGen.loadContextNode());
        il.append(new INVOKEINTERFACE(order, 3));

    }
}
项目:infobip-open-jdk-8    文件:IntType.java   
/**
 * Expects an integer on the stack and pushes a boxed integer.
 * Boxed integers are represented by an instance of
 * <code>java.lang.Integer</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(INTEGER_CLASS)));
    il.append(DUP_X1);
    il.append(SWAP);
    il.append(new INVOKESPECIAL(cpg.addMethodref(INTEGER_CLASS,
                                                 "<init>", "(I)V")));
}
项目:infobip-open-jdk-8    文件:RealType.java   
/**
 * Expects a double on the stack and pushes a boxed double. Boxed
 * double are represented by an instance of <code>java.lang.Double</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(DOUBLE_CLASS)));
    il.append(DUP_X2);
    il.append(DUP_X2);
    il.append(POP);
    il.append(new INVOKESPECIAL(cpg.addMethodref(DOUBLE_CLASS,
                                                 "<init>", "(D)V")));
}
项目:infobip-open-jdk-8    文件:BooleanType.java   
/**
 * Expects a boolean on the stack and pushes a boxed boolean.
 * Boxed booleans are represented by an instance of
 * <code>java.lang.Boolean</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(BOOLEAN_CLASS)));
    il.append(DUP_X1);
    il.append(SWAP);
    il.append(new INVOKESPECIAL(cpg.addMethodref(BOOLEAN_CLASS,
                                                 "<init>",
                                                 "(Z)V")));
}
项目:infobip-open-jdk-8    文件:NodeType.java   
/**
 * Expects a node on the stack and pushes a singleton node-set. Singleton
 * iterators are already started after construction.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        NodeSetType type) {
    ConstantPoolGen cpg = classGen.getConstantPool();
    InstructionList il = methodGen.getInstructionList();

    // Create a new instance of SingletonIterator
    il.append(new NEW(cpg.addClass(SINGLETON_ITERATOR)));
    il.append(DUP_X1);
    il.append(SWAP);
    final int init = cpg.addMethodref(SINGLETON_ITERATOR, "<init>",
                                      "(" + NODE_SIG +")V");
    il.append(new INVOKESPECIAL(init));
}
项目:infobip-open-jdk-8    文件:NodeType.java   
/**
 * Expects a node on the stack and pushes a boxed node. Boxed nodes
 * are represented by an instance of <code>com.sun.org.apache.xalan.internal.xsltc.dom.Node</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(RUNTIME_NODE_CLASS)));
    il.append(DUP_X1);
    il.append(SWAP);
    il.append(new PUSH(cpg, _type));
    il.append(new INVOKESPECIAL(cpg.addMethodref(RUNTIME_NODE_CLASS,
                                                 "<init>", "(II)V")));
}
项目:OLD-OpenJDK8    文件:UnionPathExpr.java   
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();

    final int init = cpg.addMethodref(UNION_ITERATOR_CLASS,
                                      "<init>",
                                      "("+DOM_INTF_SIG+")V");
    final int iter = cpg.addMethodref(UNION_ITERATOR_CLASS,
                                      ADD_ITERATOR,
                                      ADD_ITERATOR_SIG);

    // Create the UnionIterator and leave it on the stack
    il.append(new NEW(cpg.addClass(UNION_ITERATOR_CLASS)));
    il.append(DUP);
    il.append(methodGen.loadDOM());
    il.append(new INVOKESPECIAL(init));

    // Add the various iterators to the UnionIterator
    final int length = _components.length;
    for (int i = 0; i < length; i++) {
        _components[i].translate(classGen, methodGen);
        il.append(new INVOKEVIRTUAL(iter));
    }

    // Order the iterator only if strictly needed
    if (_reverse) {
        final int order = cpg.addInterfaceMethodref(DOM_INTF,
                                                    ORDER_ITERATOR,
                                                    ORDER_ITERATOR_SIG);
        il.append(methodGen.loadDOM());
        il.append(SWAP);
        il.append(methodGen.loadContextNode());
        il.append(new INVOKEINTERFACE(order, 3));

    }
}
项目:OLD-OpenJDK8    文件:IntType.java   
/**
 * Expects an integer on the stack and pushes a boxed integer.
 * Boxed integers are represented by an instance of
 * <code>java.lang.Integer</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(INTEGER_CLASS)));
    il.append(DUP_X1);
    il.append(SWAP);
    il.append(new INVOKESPECIAL(cpg.addMethodref(INTEGER_CLASS,
                                                 "<init>", "(I)V")));
}
项目:OLD-OpenJDK8    文件:RealType.java   
/**
 * Expects a double on the stack and pushes a boxed double. Boxed
 * double are represented by an instance of <code>java.lang.Double</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(DOUBLE_CLASS)));
    il.append(DUP_X2);
    il.append(DUP_X2);
    il.append(POP);
    il.append(new INVOKESPECIAL(cpg.addMethodref(DOUBLE_CLASS,
                                                 "<init>", "(D)V")));
}
项目:OLD-OpenJDK8    文件:BooleanType.java   
/**
 * Expects a boolean on the stack and pushes a boxed boolean.
 * Boxed booleans are represented by an instance of
 * <code>java.lang.Boolean</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(BOOLEAN_CLASS)));
    il.append(DUP_X1);
    il.append(SWAP);
    il.append(new INVOKESPECIAL(cpg.addMethodref(BOOLEAN_CLASS,
                                                 "<init>",
                                                 "(Z)V")));
}
项目:OLD-OpenJDK8    文件:NodeType.java   
/**
 * Expects a node on the stack and pushes a singleton node-set. Singleton
 * iterators are already started after construction.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        NodeSetType type) {
    ConstantPoolGen cpg = classGen.getConstantPool();
    InstructionList il = methodGen.getInstructionList();

    // Create a new instance of SingletonIterator
    il.append(new NEW(cpg.addClass(SINGLETON_ITERATOR)));
    il.append(DUP_X1);
    il.append(SWAP);
    final int init = cpg.addMethodref(SINGLETON_ITERATOR, "<init>",
                                      "(" + NODE_SIG +")V");
    il.append(new INVOKESPECIAL(init));
}
项目:OLD-OpenJDK8    文件:NodeType.java   
/**
 * Expects a node on the stack and pushes a boxed node. Boxed nodes
 * are represented by an instance of <code>com.sun.org.apache.xalan.internal.xsltc.dom.Node</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(RUNTIME_NODE_CLASS)));
    il.append(DUP_X1);
    il.append(SWAP);
    il.append(new PUSH(cpg, _type));
    il.append(new INVOKESPECIAL(cpg.addMethodref(RUNTIME_NODE_CLASS,
                                                 "<init>", "(II)V")));
}
项目:openjdk-icedtea7    文件:UnionPathExpr.java   
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();

    final int init = cpg.addMethodref(UNION_ITERATOR_CLASS,
                                      "<init>",
                                      "("+DOM_INTF_SIG+")V");
    final int iter = cpg.addMethodref(UNION_ITERATOR_CLASS,
                                      ADD_ITERATOR,
                                      ADD_ITERATOR_SIG);

    // Create the UnionIterator and leave it on the stack
    il.append(new NEW(cpg.addClass(UNION_ITERATOR_CLASS)));
    il.append(DUP);
    il.append(methodGen.loadDOM());
    il.append(new INVOKESPECIAL(init));

    // Add the various iterators to the UnionIterator
    final int length = _components.length;
    for (int i = 0; i < length; i++) {
        _components[i].translate(classGen, methodGen);
        il.append(new INVOKEVIRTUAL(iter));
    }

    // Order the iterator only if strictly needed
    if (_reverse) {
        final int order = cpg.addInterfaceMethodref(DOM_INTF,
                                                    ORDER_ITERATOR,
                                                    ORDER_ITERATOR_SIG);
        il.append(methodGen.loadDOM());
        il.append(SWAP);
        il.append(methodGen.loadContextNode());
        il.append(new INVOKEINTERFACE(order, 3));

    }
}