protected void box(final Type type) {
        switch (type.getSort()) {
            case Type.BOOLEAN:
                visitMethodInsn(INVOKESTATIC, "java/lang/Boolean", "valueOf", "(Z)Ljava/lang/Boolean;", false);
                break;
            case Type.BYTE:
                visitMethodInsn(INVOKESTATIC, "java/lang/Byte", "valueOf", "(B)Ljava/lang/Byte;", false);
                break;
            case Type.CHAR:
                visitMethodInsn(INVOKESTATIC, "java/lang/Character", "valueOf", "(C)Ljava/lang/Character;", false);
                break;
            case Type.DOUBLE:
                visitMethodInsn(INVOKESTATIC, "java/lang/Double", "valueOf", "(D)Ljava/lang/Double;", false);
                break;
            case Type.FLOAT:
                visitMethodInsn(INVOKESTATIC, "java/lang/Float", "valueOf", "(F)Ljava/lang/Float;", false);
                break;
            case Type.INT:
                visitMethodInsn(INVOKESTATIC, "java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;", false);
                break;
            case Type.LONG:
                visitMethodInsn(INVOKESTATIC, "java/lang/Long", "valueOf", "(J)Ljava/lang/Long;", false);
                break;
            case Type.SHORT:
                visitMethodInsn(INVOKESTATIC, "java/lang/Short", "valueOf", "(S)Ljava/lang/Short;", false);
                break;
            case Type.ARRAY:
            case Type.OBJECT:
                break;
            default:
                break;
        }
    }
protected void box ( final Type type ) { switch ( type . getSort ( ) ) { case Type . BOOLEAN : visitMethodInsn ( INVOKESTATIC , "java/lang/Boolean" , "valueOf" , "(Z)Ljava/lang/Boolean;" , false ) ; break ; case Type . BYTE : visitMethodInsn ( INVOKESTATIC , "java/lang/Byte" , "valueOf" , "(B)Ljava/lang/Byte;" , false ) ; break ; case Type . CHAR : visitMethodInsn ( INVOKESTATIC , "java/lang/Character" , "valueOf" , "(C)Ljava/lang/Character;" , false ) ; break ; case Type . DOUBLE : visitMethodInsn ( INVOKESTATIC , "java/lang/Double" , "valueOf" , "(D)Ljava/lang/Double;" , false ) ; break ; case Type . FLOAT : visitMethodInsn ( INVOKESTATIC , "java/lang/Float" , "valueOf" , "(F)Ljava/lang/Float;" , false ) ; break ; case Type . INT : visitMethodInsn ( INVOKESTATIC , "java/lang/Integer" , "valueOf" , "(I)Ljava/lang/Integer;" , false ) ; break ; case Type . LONG : visitMethodInsn ( INVOKESTATIC , "java/lang/Long" , "valueOf" , "(J)Ljava/lang/Long;" , false ) ; break ; case Type . SHORT : visitMethodInsn ( INVOKESTATIC , "java/lang/Short" , "valueOf" , "(S)Ljava/lang/Short;" , false ) ; break ; case Type . ARRAY : case Type . OBJECT : break ; default : break ; } }
Generate the instruction sequence needed to "box" the data on the top
of stack (if boxing is required).

@param type the <code>Type</code> of the object on the stack.