private boolean checkNumberOfArguments()

in src/main/java/org/apache/maven/plugin/compiler/Options.java [318:340]


    private boolean checkNumberOfArguments(String option, int count, boolean immediate) {
        int expected = checker.isSupportedOption(option);
        if (expected == count) {
            warning = null;
            return true;
        } else if (expected < 1) {
            if (checker instanceof ForkedCompiler) {
                return true; // That implementation actually knows nothing about which options are supported.
            }
            warning = "The '" + option + "' option is not supported.";
        } else if (expected == 0) {
            warning = "The '" + option + "' option does not expect any argument.";
        } else if (expected == 1) {
            warning = "The '" + option + "' option expects a single argument.";
        } else {
            warning = "The '" + option + "' option expects " + expected + " arguments.";
        }
        if (immediate) {
            logger.warn(warning);
            warning = null;
        }
        return false;
    }