int ac = 0;
while (ac < flags.length) {
String flag = flags[ac];
ac++;
Option option = null;
if (flag.length() > 0) {
// quick hack to speed up file processing:
// if the option does not begin with '-', there is no need to check
// most of the compiler options.
int firstOptionToCheck = flag.charAt(0) == '-' ? 0 : recognizedOptions.length-1;
for (int j=firstOptionToCheck; j<recognizedOptions.length; j++) {
if (recognizedOptions[j].matches(flag)) {
option = recognizedOptions[j];
break;
}
}
}
if (option == null) {
error("err.invalid.flag", flag);
return null;
}
if (option.hasArg()) {
if (ac == flags.length) {
error("err.req.arg", flag);
return null;
}
String operand = flags[ac];
ac++;
if (option.process(optionHelper, flag, operand))
return null;
} else {
if (option.process(optionHelper, flag))
return null;
}
}
if (options.get(PROFILE) != null && options.get(BOOTCLASSPATH) != null) {