public static void checkForRemainingOptions(String[] options) throws Exception {
  int illegalOptionsFound=0;
  StringBuffer text=new StringBuffer();
  if (options == null) {
    return;
  }
  for (  String option : options) {
    if (option.length() > 0) {
      illegalOptionsFound++;
      text.append(option + ' ');
    }
  }
  if (illegalOptionsFound > 0) {
    throw new Exception("Illegal options: " + text);
  }
}

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