@ Override protected String initValuesImpl ( final FieldCase ca ) { if ( ca == FieldCase . NULL || ca == FieldCase . BLANK ) { return null ; } String s = super . initValuesImpl ( ca ) ; int counter = 10000 ; while ( set . contains ( s ) && counter > 0 ) { s = super . initValuesImpl ( ca ) ; counter -- ; } if ( counter == 0 ) { throw new IllegalStateException ( "Could not generate unique value" ) ; } set . add ( s ) ; return s ; }
Calls initValuesImpl on the super class . If the returned value is already in the list of values initValuesImpl is called again . This happens up to 10000 times . If a new value is found it is stored in the set .