protected void unbox ( final Type type ) { switch ( type . getSort ( ) ) { case Type . BOOLEAN : visitTypeInsn ( CHECKCAST , "java/lang/Boolean" ) ; visitMethodInsn ( INVOKEVIRTUAL , "java/lang/Boolean" , "booleanValue" , "()Z" , false ) ; break ; case Type . BYTE : visitTypeInsn ( CHECKCAST , "java/lang/Byte" ) ; visitMethodInsn ( INVOKEVIRTUAL , "java/lang/Byte" , "byteValue" , "()B" , false ) ; break ; case Type . CHAR : visitTypeInsn ( CHECKCAST , "java/lang/Character" ) ; visitMethodInsn ( INVOKEVIRTUAL , "java/lang/Character" , "charValue" , "()C" , false ) ; break ; case Type . DOUBLE : visitTypeInsn ( CHECKCAST , "java/lang/Double" ) ; visitMethodInsn ( INVOKEVIRTUAL , "java/lang/Double" , "doubleValue" , "()D" , false ) ; break ; case Type . FLOAT : visitTypeInsn ( CHECKCAST , "java/lang/Float" ) ; visitMethodInsn ( INVOKEVIRTUAL , "java/lang/Float" , "floatValue" , "()F" , false ) ; break ; case Type . INT : visitTypeInsn ( CHECKCAST , "java/lang/Integer" ) ; visitMethodInsn ( INVOKEVIRTUAL , "java/lang/Integer" , "intValue" , "()I" , false ) ; break ; case Type . LONG : visitTypeInsn ( CHECKCAST , "java/lang/Long" ) ; visitMethodInsn ( INVOKEVIRTUAL , "java/lang/Long" , "longValue" , "()J" , false ) ; break ; case Type . SHORT : visitTypeInsn ( CHECKCAST , "java/lang/Short" ) ; visitMethodInsn ( INVOKEVIRTUAL , "java/lang/Short" , "shortValue" , "()S" , false ) ; break ; case Type . ARRAY : case Type . OBJECT : visitTypeInsn ( CHECKCAST , type . getInternalName ( ) ) ; break ; default : break ; } }
Generate the instruction sequence needed to unbox the boxed data at the top of stack .