public static void checkForRemainingOptions ( String [ ] options ) throws Exception { int illegalOptionsFound = 0 ; StringBuffer text = new StringBuffer ( ) ; if ( options == null ) { return ; } for ( int i = 0 ; i < options . length ; i ++ ) { if ( options [ i ] . length ( ) > 0 ) { illegalOptionsFound ++ ; text . append ( options [ i ] + ' ' ) ; } } if ( illegalOptionsFound > 0 ) { throw new Exception ( "Illegal options: " + text ) ; } }
Checks if the given array contains any non - empty options .