private void addHashCodeMethod ( ) { Modifiers modifiers = Modifiers . PUBLIC . toSynchronized ( true ) ; MethodInfo mi = addMethodIfNotFinal ( modifiers , "hashCode" , TypeDesc . INT , null ) ; if ( mi == null ) { return ; } CodeBuilder b = new CodeBuilder ( mi ) ; boolean mixIn = false ; for ( StorableProperty property : mAllProperties . values ( ) ) { if ( property . isDerived ( ) || property . isJoin ( ) ) { continue ; } TypeDesc fieldType = TypeDesc . forClass ( property . getType ( ) ) ; b . loadThis ( ) ; b . loadField ( property . getName ( ) , fieldType ) ; CodeBuilderUtil . addValueHashCodeCall ( b , fieldType , true , mixIn ) ; mixIn = true ; } b . returnValue ( TypeDesc . INT ) ; }
Defines a hashCode method .