private void buildMatch ( Object val ) { if ( val instanceof String [ ] ) { _match = ( String [ ] ) val ; } else { Iterator matchIterator = null ; // this should return null, but we should handle it it does matchIterator = IteratorFactory . createIterator ( val ) ; if ( matchIterator == null ) matchIterator = IteratorFactory . EMPTY_ITERATOR ; List matchList = new ArrayList ( ) ; while ( matchIterator . hasNext ( ) ) { Object o = matchIterator . next ( ) ; if ( o != null ) matchList . add ( o . toString ( ) ) ; } int size = matchList . size ( ) ; _match = new String [ size ] ; for ( int i = 0 ; i < size ; i ++ ) { _match [ i ] = matchList . get ( i ) . toString ( ) ; } } if ( logger . isDebugEnabled ( ) ) { logger . debug ( "****** CheckboxGroup Matches ******" ) ; if ( _match != null ) { for ( int i = 0 ; i < _match . length ; i ++ ) { logger . debug ( i + ": " + _match [ i ] ) ; } } } }
This method will build the match list should this be a hashmap?