private synchronized void name ( InstructionGroup group , ParserClassNode classNode ) { // generate an MD5 hash across the buffer, use only the first 96 bit MD5Digester digester = new MD5Digester ( classNode . name ) ; group . getInstructions ( ) . accept ( digester ) ; for ( FieldNode field : group . getFields ( ) ) digester . visitField ( field ) ; byte [ ] hash = digester . getMD5Hash ( ) ; byte [ ] hash96 = new byte [ 12 ] ; System . arraycopy ( hash , 0 , hash96 , 0 , 12 ) ; // generate a name for the group based on the hash String name = group . getRoot ( ) . isActionRoot ( ) ? "Action$" : "VarInit$" ; name += CUSTOM_BASE64 . encodeToString ( hash96 , false ) ; group . setName ( name ) ; }
set a group name base on the hash across all group instructions and fields