private String generateSafeMethodName ( StorableInfo info , String prefix ) { Class type = info . getStorableType ( ) ; // Try a few times to generate a unique name. There's nothing special // about choosing 100 as the limit. int value = 0 ; for ( int i = 0 ; i < 100 ; i ++ ) { String name = prefix + value ; if ( ! methodExists ( type , name ) ) { return name ; } value = name . hashCode ( ) ; } throw new InternalError ( "Unable to create unique method name starting with: " + prefix ) ; }
Generates a property name which doesn t clash with any already defined .