modules/jretools/src/main/java/org/apache/harmony/jretools/keytool/Main.java [93:132]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public static void run(String[] args) throws Exception {
        KeytoolParameters param = ArgumentsParser.parseArgs(args);

        if (param == null) {
            HelpPrinter.printHelp();
            System.exit(-1);
        }

        Command command = param.getCommand();

        // all commands except printcert and help work with a store
        if (command != Command.PRINTCERT && command != Command.HELP) {
            // all commands that work with store except list and export
            // need store password to with keystore.
            if (param.getStorePass() == null && command != Command.LIST
                    && command != Command.EXPORT) {
                throw new KeytoolException(
                        "Must specify store password to work with this command.");
            }
            // prompt for additional parameters if some of the expected
            // ones have not been specified.
            ArgumentsParser.getAdditionalParameters(param);

            // print the warning if store password is not set
            if (param.getStorePass() == null) {
                System.out.println("\nWARNING!!!\nThe integrity "
                        + "of the keystore data has NOT been checked!\n"
                        + "To check it you must provide"
                        + " your keystore password!\n");
            }
        }

        // the work is being done here
        doWork(param);

        if (param.isNeedSaveKS()) {
            // save the store
            KeytoolKSLoaderSaver.saveStore(param);
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



modules/jdktools/src/main/java/org/apache/harmony/tools/keytool/Main.java [93:132]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public static void run(String[] args) throws Exception {
        KeytoolParameters param = ArgumentsParser.parseArgs(args);

        if (param == null) {
            HelpPrinter.printHelp();
            System.exit(-1);
        }

        Command command = param.getCommand();

        // all commands except printcert and help work with a store
        if (command != Command.PRINTCERT && command != Command.HELP) {
            // all commands that work with store except list and export
            // need store password to with keystore.
            if (param.getStorePass() == null && command != Command.LIST
                    && command != Command.EXPORT) {
                throw new KeytoolException(
                        "Must specify store password to work with this command.");
            }
            // prompt for additional parameters if some of the expected
            // ones have not been specified.
            ArgumentsParser.getAdditionalParameters(param);

            // print the warning if store password is not set
            if (param.getStorePass() == null) {
                System.out.println("\nWARNING!!!\nThe integrity "
                        + "of the keystore data has NOT been checked!\n"
                        + "To check it you must provide"
                        + " your keystore password!\n");
            }
        }

        // the work is being done here
        doWork(param);

        if (param.isNeedSaveKS()) {
            // save the store
            KeytoolKSLoaderSaver.saveStore(param);
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



