static void putAbstractType ( final SymbolTable symbolTable , final int abstractType , final ByteVector output ) { int arrayDimensions = ( abstractType & Frame . DIM_MASK ) >> DIM_SHIFT ; if ( arrayDimensions == 0 ) { int typeValue = abstractType & VALUE_MASK ; switch ( abstractType & KIND_MASK ) { case CONSTANT_KIND : output . putByte ( typeValue ) ; break ; case REFERENCE_KIND : output . putByte ( ITEM_OBJECT ) . putShort ( symbolTable . addConstantClass ( symbolTable . getType ( typeValue ) . value ) . index ) ; break ; case UNINITIALIZED_KIND : output . putByte ( ITEM_UNINITIALIZED ) . putShort ( ( int ) symbolTable . getType ( typeValue ) . data ) ; break ; default : throw new AssertionError ( ) ; } } else { // Case of an array type, we need to build its descriptor first. StringBuilder typeDescriptor = new StringBuilder ( ) ; while ( arrayDimensions -- > 0 ) { typeDescriptor . append ( ' ' ) ; } if ( ( abstractType & KIND_MASK ) == REFERENCE_KIND ) { typeDescriptor . append ( ' ' ) . append ( symbolTable . getType ( abstractType & VALUE_MASK ) . value ) . append ( ' ' ) ; } else { switch ( abstractType & VALUE_MASK ) { case Frame . ITEM_ASM_BOOLEAN : typeDescriptor . append ( ' ' ) ; break ; case Frame . ITEM_ASM_BYTE : typeDescriptor . append ( ' ' ) ; break ; case Frame . ITEM_ASM_CHAR : typeDescriptor . append ( ' ' ) ; break ; case Frame . ITEM_ASM_SHORT : typeDescriptor . append ( ' ' ) ; break ; case Frame . ITEM_INTEGER : typeDescriptor . append ( ' ' ) ; break ; case Frame . ITEM_FLOAT : typeDescriptor . append ( ' ' ) ; break ; case Frame . ITEM_LONG : typeDescriptor . append ( ' ' ) ; break ; case Frame . ITEM_DOUBLE : typeDescriptor . append ( ' ' ) ; break ; default : throw new AssertionError ( ) ; } } output . putByte ( ITEM_OBJECT ) . putShort ( symbolTable . addConstantClass ( typeDescriptor . toString ( ) ) . index ) ; } }
Put the given abstract type in the given ByteVector using the JVMS verification_type_info format used in StackMapTable attributes .