public static void pushClassType ( CodeAttribute b , String classType ) { if ( classType . length ( ) != 1 ) { if ( classType . startsWith ( "L" ) && classType . endsWith ( ";" ) ) { classType = classType . substring ( 1 , classType . length ( ) - 1 ) ; } b . loadClass ( classType ) ; } else { char type = classType . charAt ( 0 ) ; switch ( type ) { case ' ' : b . getstatic ( Integer . class . getName ( ) , TYPE , LJAVA_LANG_CLASS ) ; break ; case ' ' : b . getstatic ( Long . class . getName ( ) , TYPE , LJAVA_LANG_CLASS ) ; break ; case ' ' : b . getstatic ( Short . class . getName ( ) , TYPE , LJAVA_LANG_CLASS ) ; break ; case ' ' : b . getstatic ( Float . class . getName ( ) , TYPE , LJAVA_LANG_CLASS ) ; break ; case ' ' : b . getstatic ( Double . class . getName ( ) , TYPE , LJAVA_LANG_CLASS ) ; break ; case ' ' : b . getstatic ( Byte . class . getName ( ) , TYPE , LJAVA_LANG_CLASS ) ; break ; case ' ' : b . getstatic ( Character . class . getName ( ) , TYPE , LJAVA_LANG_CLASS ) ; break ; case ' ' : b . getstatic ( Boolean . class . getName ( ) , TYPE , LJAVA_LANG_CLASS ) ; break ; default : throw new RuntimeException ( "Cannot handle primitive type: " + type ) ; } } }
Pushes a class type onto the stack from the string representation This can also handle primitives