private void parseMethod ( ) throws IOException { int accessFlags = readShort ( ) ; int nameIndex = readShort ( ) ; int descriptorIndex = readShort ( ) ; JavaMethod method = new JavaMethod ( _loader ) ; method . setJavaClass ( _class ) ; method . setName ( _cp . getUtf8 ( nameIndex ) . getValue ( ) ) ; method . setDescriptor ( _cp . getUtf8 ( descriptorIndex ) . getValue ( ) ) ; method . setAccessFlags ( accessFlags ) ; int attributesCount = readShort ( ) ; for ( int i = 0 ; i < attributesCount ; i ++ ) { Attribute attr = parseAttribute ( ) ; method . addAttribute ( attr ) ; if ( attr instanceof ExceptionsAttribute ) { ExceptionsAttribute exn = ( ExceptionsAttribute ) attr ; ArrayList < String > exnNames = exn . getExceptionList ( ) ; if ( exnNames . size ( ) > 0 ) { JClass [ ] exnClasses = new JClass [ exnNames . size ( ) ] ; for ( int j = 0 ; j < exnNames . size ( ) ; j ++ ) { String exnName = exnNames . get ( j ) . replace ( ' ' , ' ' ) ; exnClasses [ j ] = _loader . forName ( exnName ) ; } method . setExceptionTypes ( exnClasses ) ; } } } _class . addMethod ( method ) ; }
Parses a method entry .