private static int type ( final ClassWriter cw , final String desc ) { String t ; int index = desc . charAt ( 0 ) == ' ' ? desc . indexOf ( ' ' ) + 1 : 0 ; switch ( desc . charAt ( index ) ) { case ' ' : return 0 ; case ' ' : case ' ' : case ' ' : case ' ' : case ' ' : return INTEGER ; case ' ' : return FLOAT ; case ' ' : return LONG ; case ' ' : return DOUBLE ; case ' ' : // stores the internal name, not the descriptor! t = desc . substring ( index + 1 , desc . length ( ) - 1 ) ; return OBJECT | cw . addType ( t ) ; // case '[': default : // extracts the dimensions and the element type int data ; int dims = index + 1 ; while ( desc . charAt ( dims ) == ' ' ) { ++ dims ; } switch ( desc . charAt ( dims ) ) { case ' ' : data = BOOLEAN ; break ; case ' ' : data = CHAR ; break ; case ' ' : data = BYTE ; break ; case ' ' : data = SHORT ; break ; case ' ' : data = INTEGER ; break ; case ' ' : data = FLOAT ; break ; case ' ' : data = LONG ; break ; case ' ' : data = DOUBLE ; break ; // case 'L': default : // stores the internal name, not the descriptor t = desc . substring ( dims + 1 , desc . length ( ) - 1 ) ; data = OBJECT | cw . addType ( t ) ; } return ( dims - index ) << 28 | data ; } }
Returns the int encoding of the given type .