Java Code Examples for sun.rmi.rmic.Main#error()

The following examples show how to use sun.rmi.rmic.Main#error() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IDLGenerator.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Examine and consume command line arguments.
 * @param argv The command line arguments. Ignore null
 * and unknown arguments. Set each consumed argument to null.
 * @param error Report any errors using the main.error() methods.
 * @return true if no errors, false otherwise.
 */
public boolean parseArgs(String argv[], Main main) {
    boolean result = super.parseArgs(argv,main);
    String idlFrom;
    String idlTo;
    if (result) {
    nextArg:
        for (int i = 0; i < argv.length; i++) {
            if (argv[i] != null) {
                if (argv[i].equalsIgnoreCase("-idl")) {
                    idl = true;
                    argv[i] = null;
                }
                else if ( argv[i].equalsIgnoreCase( "-valueMethods" ) ) {
                    valueMethods = true;
                    argv[i] = null;
                }
                else if ( argv[i].equalsIgnoreCase( "-noValueMethods" ) ) {
                    valueMethods = false;
                    argv[i] = null;
                }
                else if ( argv[i].equalsIgnoreCase( "-init" ) ) {
                    factory = false;
                    argv[i] = null;
            }
                else if ( argv[i].equalsIgnoreCase( "-factory" ) ) {
                    factory = true;
                    argv[i] = null;
        }
                else if ( argv[i].equalsIgnoreCase( "-idlfile" ) ) {
                    argv[i] = null;
                    if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                        idlFrom = argv[i];
                        argv[i] = null;
                        if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                            idlTo = argv[i];
                            argv[i] = null;
                            ifHash.put( idlFrom,idlTo );
                            continue nextArg;
    }
                    }
                    main.error("rmic.option.requires.argument", "-idlfile");
                    result = false;
                }
                else if ( argv[i].equalsIgnoreCase( "-idlmodule" ) ) {
                    argv[i] = null;
                    if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                        idlFrom = argv[i];
                        argv[i] = null;
                        if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                            idlTo = argv[i];
                            argv[i] = null;
                            imHash.put( idlFrom,idlTo );
                            continue nextArg;
                        }
                    }
                    main.error("rmic.option.requires.argument", "-idlmodule");
                    result = false;
                }


            }
        }
    }
    return result;
}
 
Example 2
Source File: StubGenerator.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Examine and consume command line arguments.
 * @param argv The command line arguments. Ignore null
 * and unknown arguments. Set each consumed argument to null.
 * @param error Report any errors using the main.error() methods.
 * @return true if no errors, false otherwise.
 */
public boolean parseArgs(String argv[], Main main) {
    Object marker = new Object() ;

    // Reset any cached options...

    reverseIDs = false;
    localStubs = true;
    useHash = true;
    stubBaseClass = DEFAULT_STUB_CLASS;
    //       tieBaseClass = DEFAULT_TIE_CLASS;
    transactionalObjects = new Hashtable() ;

    // Parse options...

    boolean result = super.parseArgs(argv,main);
    if (result) {
        for (int i = 0; i < argv.length; i++) {
            if (argv[i] != null) {
                String arg = argv[i].toLowerCase();
                if (arg.equals("-iiop")) {
                    argv[i] = null;
                } else if (arg.equals("-xreverseids")) {
                    reverseIDs = true;
                    argv[i] = null;
                } else if (arg.equals("-nolocalstubs")) {
                    localStubs = false;
                    argv[i] = null;
                } else if (arg.equals("-xnohash")) {
                    useHash = false;
                    argv[i] = null;
                } else if (argv[i].equals("-standardPackage")) {
                    standardPackage = true;
                    argv[i] = null;
                } else if (argv[i].equals("-emitPermissionCheck")) {
                    emitPermissionCheck = true;
                    argv[i] = null;
                } else if (arg.equals("-xstubbase")) {
                    argv[i] = null;
                    if (++i < argv.length && argv[i] != null && !argv[i].startsWith("-")) {
                        stubBaseClass = argv[i];
                        argv[i] = null;
                    } else {
                        main.error("rmic.option.requires.argument", "-Xstubbase");
                        result = false;
                    }
                } else if (arg.equals("-xtiebase")) {
                    argv[i] = null;
                    if (++i < argv.length && argv[i] != null && !argv[i].startsWith("-")) {
                        tieBaseClass = argv[i];
                        argv[i] = null;
                    } else {
                        main.error("rmic.option.requires.argument", "-Xtiebase");
                        result = false;
                    }
                } else if (arg.equals("-transactional" )) {
                    // Scan for the next non-flag argument.
                    // Assume that it is a class name and add it
                    // to the list of transactional classes.
                    for ( int ctr=i+1; ctr<argv.length; ctr++ ) {
                        if (argv[ctr].charAt(1) != '-') {
                            transactionalObjects.put( argv[ctr], marker ) ;
                            break ;
                        }
                    }
                    argv[i] = null;
                } else if (arg.equals( "-poa" )) {
                    POATie = true ;
                    argv[i] = null;
                }
            }
        }
    }
    if(POATie){
        tieBaseClass = DEFAULT_POA_TIE_CLASS;
    } else {
        tieBaseClass = DEFAULT_TIE_CLASS;
    }
    return result;
}
 
Example 3
Source File: IDLGenerator.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Examine and consume command line arguments.
 * @param argv The command line arguments. Ignore null
 * and unknown arguments. Set each consumed argument to null.
 * @param error Report any errors using the main.error() methods.
 * @return true if no errors, false otherwise.
 */
public boolean parseArgs(String argv[], Main main) {
    boolean result = super.parseArgs(argv,main);
    String idlFrom;
    String idlTo;
    if (result) {
    nextArg:
        for (int i = 0; i < argv.length; i++) {
            if (argv[i] != null) {
                if (argv[i].equalsIgnoreCase("-idl")) {
                    idl = true;
                    argv[i] = null;
                }
                else if ( argv[i].equalsIgnoreCase( "-valueMethods" ) ) {
                    valueMethods = true;
                    argv[i] = null;
                }
                else if ( argv[i].equalsIgnoreCase( "-noValueMethods" ) ) {
                    valueMethods = false;
                    argv[i] = null;
                }
                else if ( argv[i].equalsIgnoreCase( "-init" ) ) {
                    factory = false;
                    argv[i] = null;
            }
                else if ( argv[i].equalsIgnoreCase( "-factory" ) ) {
                    factory = true;
                    argv[i] = null;
        }
                else if ( argv[i].equalsIgnoreCase( "-idlfile" ) ) {
                    argv[i] = null;
                    if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                        idlFrom = argv[i];
                        argv[i] = null;
                        if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                            idlTo = argv[i];
                            argv[i] = null;
                            ifHash.put( idlFrom,idlTo );
                            continue nextArg;
    }
                    }
                    main.error("rmic.option.requires.argument", "-idlfile");
                    result = false;
                }
                else if ( argv[i].equalsIgnoreCase( "-idlmodule" ) ) {
                    argv[i] = null;
                    if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                        idlFrom = argv[i];
                        argv[i] = null;
                        if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                            idlTo = argv[i];
                            argv[i] = null;
                            imHash.put( idlFrom,idlTo );
                            continue nextArg;
                        }
                    }
                    main.error("rmic.option.requires.argument", "-idlmodule");
                    result = false;
                }


            }
        }
    }
    return result;
}
 
Example 4
Source File: StubGenerator.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Examine and consume command line arguments.
 * @param argv The command line arguments. Ignore null
 * and unknown arguments. Set each consumed argument to null.
 * @param error Report any errors using the main.error() methods.
 * @return true if no errors, false otherwise.
 */
public boolean parseArgs(String argv[], Main main) {
    Object marker = new Object() ;

    // Reset any cached options...

    reverseIDs = false;
    localStubs = true;
    useHash = true;
    stubBaseClass = DEFAULT_STUB_CLASS;
    //       tieBaseClass = DEFAULT_TIE_CLASS;
    transactionalObjects = new Hashtable() ;

    // Parse options...

    boolean result = super.parseArgs(argv,main);
    if (result) {
        for (int i = 0; i < argv.length; i++) {
            if (argv[i] != null) {
                String arg = argv[i].toLowerCase();
                if (arg.equals("-iiop")) {
                    argv[i] = null;
                } else if (arg.equals("-xreverseids")) {
                    reverseIDs = true;
                    argv[i] = null;
                } else if (arg.equals("-nolocalstubs")) {
                    localStubs = false;
                    argv[i] = null;
                } else if (arg.equals("-xnohash")) {
                    useHash = false;
                    argv[i] = null;
                } else if (argv[i].equals("-standardPackage")) {
                    standardPackage = true;
                    argv[i] = null;
                } else if (argv[i].equals("-emitPermissionCheck")) {
                    emitPermissionCheck = true;
                    argv[i] = null;
                } else if (arg.equals("-xstubbase")) {
                    argv[i] = null;
                    if (++i < argv.length && argv[i] != null && !argv[i].startsWith("-")) {
                        stubBaseClass = argv[i];
                        argv[i] = null;
                    } else {
                        main.error("rmic.option.requires.argument", "-Xstubbase");
                        result = false;
                    }
                } else if (arg.equals("-xtiebase")) {
                    argv[i] = null;
                    if (++i < argv.length && argv[i] != null && !argv[i].startsWith("-")) {
                        tieBaseClass = argv[i];
                        argv[i] = null;
                    } else {
                        main.error("rmic.option.requires.argument", "-Xtiebase");
                        result = false;
                    }
                } else if (arg.equals("-transactional" )) {
                    // Scan for the next non-flag argument.
                    // Assume that it is a class name and add it
                    // to the list of transactional classes.
                    for ( int ctr=i+1; ctr<argv.length; ctr++ ) {
                        if (argv[ctr].charAt(1) != '-') {
                            transactionalObjects.put( argv[ctr], marker ) ;
                            break ;
                        }
                    }
                    argv[i] = null;
                } else if (arg.equals( "-poa" )) {
                    POATie = true ;
                    argv[i] = null;
                }
            }
        }
    }
    if(POATie){
        tieBaseClass = DEFAULT_POA_TIE_CLASS;
    } else {
        tieBaseClass = DEFAULT_TIE_CLASS;
    }
    return result;
}
 
Example 5
Source File: IDLGenerator.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Examine and consume command line arguments.
 * @param argv The command line arguments. Ignore null
 * and unknown arguments. Set each consumed argument to null.
 * @param error Report any errors using the main.error() methods.
 * @return true if no errors, false otherwise.
 */
public boolean parseArgs(String argv[], Main main) {
    boolean result = super.parseArgs(argv,main);
    String idlFrom;
    String idlTo;
    if (result) {
    nextArg:
        for (int i = 0; i < argv.length; i++) {
            if (argv[i] != null) {
                if (argv[i].equalsIgnoreCase("-idl")) {
                    idl = true;
                    argv[i] = null;
                }
                else if ( argv[i].equalsIgnoreCase( "-valueMethods" ) ) {
                    valueMethods = true;
                    argv[i] = null;
                }
                else if ( argv[i].equalsIgnoreCase( "-noValueMethods" ) ) {
                    valueMethods = false;
                    argv[i] = null;
                }
                else if ( argv[i].equalsIgnoreCase( "-init" ) ) {
                    factory = false;
                    argv[i] = null;
            }
                else if ( argv[i].equalsIgnoreCase( "-factory" ) ) {
                    factory = true;
                    argv[i] = null;
        }
                else if ( argv[i].equalsIgnoreCase( "-idlfile" ) ) {
                    argv[i] = null;
                    if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                        idlFrom = argv[i];
                        argv[i] = null;
                        if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                            idlTo = argv[i];
                            argv[i] = null;
                            ifHash.put( idlFrom,idlTo );
                            continue nextArg;
    }
                    }
                    main.error("rmic.option.requires.argument", "-idlfile");
                    result = false;
                }
                else if ( argv[i].equalsIgnoreCase( "-idlmodule" ) ) {
                    argv[i] = null;
                    if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                        idlFrom = argv[i];
                        argv[i] = null;
                        if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                            idlTo = argv[i];
                            argv[i] = null;
                            imHash.put( idlFrom,idlTo );
                            continue nextArg;
                        }
                    }
                    main.error("rmic.option.requires.argument", "-idlmodule");
                    result = false;
                }


            }
        }
    }
    return result;
}
 
Example 6
Source File: StubGenerator.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Examine and consume command line arguments.
 * @param argv The command line arguments. Ignore null
 * and unknown arguments. Set each consumed argument to null.
 * @param error Report any errors using the main.error() methods.
 * @return true if no errors, false otherwise.
 */
public boolean parseArgs(String argv[], Main main) {
    Object marker = new Object() ;

    // Reset any cached options...

    reverseIDs = false;
    localStubs = true;
    useHash = true;
    stubBaseClass = DEFAULT_STUB_CLASS;
    //       tieBaseClass = DEFAULT_TIE_CLASS;
    transactionalObjects = new Hashtable() ;

    // Parse options...

    boolean result = super.parseArgs(argv,main);
    if (result) {
        for (int i = 0; i < argv.length; i++) {
            if (argv[i] != null) {
                String arg = argv[i].toLowerCase();
                if (arg.equals("-iiop")) {
                    argv[i] = null;
                } else if (arg.equals("-xreverseids")) {
                    reverseIDs = true;
                    argv[i] = null;
                } else if (arg.equals("-nolocalstubs")) {
                    localStubs = false;
                    argv[i] = null;
                } else if (arg.equals("-xnohash")) {
                    useHash = false;
                    argv[i] = null;
                } else if (argv[i].equals("-standardPackage")) {
                    standardPackage = true;
                    argv[i] = null;
                } else if (argv[i].equals("-emitPermissionCheck")) {
                    emitPermissionCheck = true;
                    argv[i] = null;
                } else if (arg.equals("-xstubbase")) {
                    argv[i] = null;
                    if (++i < argv.length && argv[i] != null && !argv[i].startsWith("-")) {
                        stubBaseClass = argv[i];
                        argv[i] = null;
                    } else {
                        main.error("rmic.option.requires.argument", "-Xstubbase");
                        result = false;
                    }
                } else if (arg.equals("-xtiebase")) {
                    argv[i] = null;
                    if (++i < argv.length && argv[i] != null && !argv[i].startsWith("-")) {
                        tieBaseClass = argv[i];
                        argv[i] = null;
                    } else {
                        main.error("rmic.option.requires.argument", "-Xtiebase");
                        result = false;
                    }
                } else if (arg.equals("-transactional" )) {
                    // Scan for the next non-flag argument.
                    // Assume that it is a class name and add it
                    // to the list of transactional classes.
                    for ( int ctr=i+1; ctr<argv.length; ctr++ ) {
                        if (argv[ctr].charAt(1) != '-') {
                            transactionalObjects.put( argv[ctr], marker ) ;
                            break ;
                        }
                    }
                    argv[i] = null;
                } else if (arg.equals( "-poa" )) {
                    POATie = true ;
                    argv[i] = null;
                }
            }
        }
    }
    if(POATie){
        tieBaseClass = DEFAULT_POA_TIE_CLASS;
    } else {
        tieBaseClass = DEFAULT_TIE_CLASS;
    }
    return result;
}
 
Example 7
Source File: IDLGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Examine and consume command line arguments.
 * @param argv The command line arguments. Ignore null
 * and unknown arguments. Set each consumed argument to null.
 * @param error Report any errors using the main.error() methods.
 * @return true if no errors, false otherwise.
 */
public boolean parseArgs(String argv[], Main main) {
    boolean result = super.parseArgs(argv,main);
    String idlFrom;
    String idlTo;
    if (result) {
    nextArg:
        for (int i = 0; i < argv.length; i++) {
            if (argv[i] != null) {
                if (argv[i].equalsIgnoreCase("-idl")) {
                    idl = true;
                    argv[i] = null;
                }
                else if ( argv[i].equalsIgnoreCase( "-valueMethods" ) ) {
                    valueMethods = true;
                    argv[i] = null;
                }
                else if ( argv[i].equalsIgnoreCase( "-noValueMethods" ) ) {
                    valueMethods = false;
                    argv[i] = null;
                }
                else if ( argv[i].equalsIgnoreCase( "-init" ) ) {
                    factory = false;
                    argv[i] = null;
            }
                else if ( argv[i].equalsIgnoreCase( "-factory" ) ) {
                    factory = true;
                    argv[i] = null;
        }
                else if ( argv[i].equalsIgnoreCase( "-idlfile" ) ) {
                    argv[i] = null;
                    if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                        idlFrom = argv[i];
                        argv[i] = null;
                        if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                            idlTo = argv[i];
                            argv[i] = null;
                            ifHash.put( idlFrom,idlTo );
                            continue nextArg;
    }
                    }
                    main.error("rmic.option.requires.argument", "-idlfile");
                    result = false;
                }
                else if ( argv[i].equalsIgnoreCase( "-idlmodule" ) ) {
                    argv[i] = null;
                    if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                        idlFrom = argv[i];
                        argv[i] = null;
                        if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                            idlTo = argv[i];
                            argv[i] = null;
                            imHash.put( idlFrom,idlTo );
                            continue nextArg;
                        }
                    }
                    main.error("rmic.option.requires.argument", "-idlmodule");
                    result = false;
                }


            }
        }
    }
    return result;
}
 
Example 8
Source File: StubGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Examine and consume command line arguments.
 * @param argv The command line arguments. Ignore null
 * and unknown arguments. Set each consumed argument to null.
 * @param error Report any errors using the main.error() methods.
 * @return true if no errors, false otherwise.
 */
public boolean parseArgs(String argv[], Main main) {
    Object marker = new Object() ;

    // Reset any cached options...

    reverseIDs = false;
    localStubs = true;
    useHash = true;
    stubBaseClass = DEFAULT_STUB_CLASS;
    //       tieBaseClass = DEFAULT_TIE_CLASS;
    transactionalObjects = new Hashtable() ;

    // Parse options...

    boolean result = super.parseArgs(argv,main);
    if (result) {
        for (int i = 0; i < argv.length; i++) {
            if (argv[i] != null) {
                String arg = argv[i].toLowerCase();
                if (arg.equals("-iiop")) {
                    argv[i] = null;
                } else if (arg.equals("-xreverseids")) {
                    reverseIDs = true;
                    argv[i] = null;
                } else if (arg.equals("-nolocalstubs")) {
                    localStubs = false;
                    argv[i] = null;
                } else if (arg.equals("-xnohash")) {
                    useHash = false;
                    argv[i] = null;
                } else if (argv[i].equals("-standardPackage")) {
                    standardPackage = true;
                    argv[i] = null;
                } else if (argv[i].equals("-emitPermissionCheck")) {
                    emitPermissionCheck = true;
                    argv[i] = null;
                } else if (arg.equals("-xstubbase")) {
                    argv[i] = null;
                    if (++i < argv.length && argv[i] != null && !argv[i].startsWith("-")) {
                        stubBaseClass = argv[i];
                        argv[i] = null;
                    } else {
                        main.error("rmic.option.requires.argument", "-Xstubbase");
                        result = false;
                    }
                } else if (arg.equals("-xtiebase")) {
                    argv[i] = null;
                    if (++i < argv.length && argv[i] != null && !argv[i].startsWith("-")) {
                        tieBaseClass = argv[i];
                        argv[i] = null;
                    } else {
                        main.error("rmic.option.requires.argument", "-Xtiebase");
                        result = false;
                    }
                } else if (arg.equals("-transactional" )) {
                    // Scan for the next non-flag argument.
                    // Assume that it is a class name and add it
                    // to the list of transactional classes.
                    for ( int ctr=i+1; ctr<argv.length; ctr++ ) {
                        if (argv[ctr].charAt(1) != '-') {
                            transactionalObjects.put( argv[ctr], marker ) ;
                            break ;
                        }
                    }
                    argv[i] = null;
                } else if (arg.equals( "-poa" )) {
                    POATie = true ;
                    argv[i] = null;
                }
            }
        }
    }
    if(POATie){
        tieBaseClass = DEFAULT_POA_TIE_CLASS;
    } else {
        tieBaseClass = DEFAULT_TIE_CLASS;
    }
    return result;
}
 
Example 9
Source File: IDLGenerator.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Examine and consume command line arguments.
 * @param argv The command line arguments. Ignore null
 * and unknown arguments. Set each consumed argument to null.
 * @param main Report any errors using the main.error() methods.
 * @return true if no errors, false otherwise.
 */
public boolean parseArgs(String argv[], Main main) {
    boolean result = super.parseArgs(argv,main);
    String idlFrom;
    String idlTo;
    if (result) {
    nextArg:
        for (int i = 0; i < argv.length; i++) {
            if (argv[i] != null) {
                if (argv[i].equalsIgnoreCase("-idl")) {
                    idl = true;
                    argv[i] = null;
                }
                else if ( argv[i].equalsIgnoreCase( "-valueMethods" ) ) {
                    valueMethods = true;
                    argv[i] = null;
                }
                else if ( argv[i].equalsIgnoreCase( "-noValueMethods" ) ) {
                    valueMethods = false;
                    argv[i] = null;
                }
                else if ( argv[i].equalsIgnoreCase( "-init" ) ) {
                    factory = false;
                    argv[i] = null;
                }
                else if ( argv[i].equalsIgnoreCase( "-factory" ) ) {
                    factory = true;
                    argv[i] = null;
                }
                else if ( argv[i].equalsIgnoreCase( "-idlfile" ) ) {
                    argv[i] = null;
                    if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                        idlFrom = argv[i];
                        argv[i] = null;
                        if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                            idlTo = argv[i];
                            argv[i] = null;
                            ifHash.put( idlFrom,idlTo );
                            continue nextArg;
                        }
                    }
                    main.error("rmic.option.requires.argument", "-idlfile");
                    result = false;
                }
                else if ( argv[i].equalsIgnoreCase( "-idlmodule" ) ) {
                    argv[i] = null;
                    if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                        idlFrom = argv[i];
                        argv[i] = null;
                        if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                            idlTo = argv[i];
                            argv[i] = null;
                            imHash.put( idlFrom,idlTo );
                            continue nextArg;
                        }
                    }
                    main.error("rmic.option.requires.argument", "-idlmodule");
                    result = false;
                }


            }
        }
    }
    return result;
}
 
Example 10
Source File: StubGenerator.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Examine and consume command line arguments.
 * @param argv The command line arguments. Ignore null
 * and unknown arguments. Set each consumed argument to null.
 * @param error Report any errors using the main.error() methods.
 * @return true if no errors, false otherwise.
 */
public boolean parseArgs(String argv[], Main main) {
    Object marker = new Object() ;

    // Reset any cached options...

    reverseIDs = false;
    localStubs = true;
    useHash = true;
    stubBaseClass = DEFAULT_STUB_CLASS;
    //       tieBaseClass = DEFAULT_TIE_CLASS;
    transactionalObjects = new Hashtable() ;

    // Parse options...

    boolean result = super.parseArgs(argv,main);
    if (result) {
        for (int i = 0; i < argv.length; i++) {
            if (argv[i] != null) {
                String arg = argv[i].toLowerCase();
                if (arg.equals("-iiop")) {
                    argv[i] = null;
                } else if (arg.equals("-xreverseids")) {
                    reverseIDs = true;
                    argv[i] = null;
                } else if (arg.equals("-nolocalstubs")) {
                    localStubs = false;
                    argv[i] = null;
                } else if (arg.equals("-xnohash")) {
                    useHash = false;
                    argv[i] = null;
                } else if (argv[i].equals("-standardPackage")) {
                    standardPackage = true;
                    argv[i] = null;
                } else if (argv[i].equals("-emitPermissionCheck")) {
                    emitPermissionCheck = true;
                    argv[i] = null;
                } else if (arg.equals("-xstubbase")) {
                    argv[i] = null;
                    if (++i < argv.length && argv[i] != null && !argv[i].startsWith("-")) {
                        stubBaseClass = argv[i];
                        argv[i] = null;
                    } else {
                        main.error("rmic.option.requires.argument", "-Xstubbase");
                        result = false;
                    }
                } else if (arg.equals("-xtiebase")) {
                    argv[i] = null;
                    if (++i < argv.length && argv[i] != null && !argv[i].startsWith("-")) {
                        tieBaseClass = argv[i];
                        argv[i] = null;
                    } else {
                        main.error("rmic.option.requires.argument", "-Xtiebase");
                        result = false;
                    }
                } else if (arg.equals("-transactional" )) {
                    // Scan for the next non-flag argument.
                    // Assume that it is a class name and add it
                    // to the list of transactional classes.
                    for ( int ctr=i+1; ctr<argv.length; ctr++ ) {
                        if (argv[ctr].charAt(1) != '-') {
                            transactionalObjects.put( argv[ctr], marker ) ;
                            break ;
                        }
                    }
                    argv[i] = null;
                } else if (arg.equals( "-poa" )) {
                    POATie = true ;
                    argv[i] = null;
                }
            }
        }
    }
    if(POATie){
        tieBaseClass = DEFAULT_POA_TIE_CLASS;
    } else {
        tieBaseClass = DEFAULT_TIE_CLASS;
    }
    return result;
}
 
Example 11
Source File: IDLGenerator.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Examine and consume command line arguments.
 * @param argv The command line arguments. Ignore null
 * and unknown arguments. Set each consumed argument to null.
 * @param error Report any errors using the main.error() methods.
 * @return true if no errors, false otherwise.
 */
public boolean parseArgs(String argv[], Main main) {
    boolean result = super.parseArgs(argv,main);
    String idlFrom;
    String idlTo;
    if (result) {
    nextArg:
        for (int i = 0; i < argv.length; i++) {
            if (argv[i] != null) {
                if (argv[i].equalsIgnoreCase("-idl")) {
                    idl = true;
                    argv[i] = null;
                }
                else if ( argv[i].equalsIgnoreCase( "-valueMethods" ) ) {
                    valueMethods = true;
                    argv[i] = null;
                }
                else if ( argv[i].equalsIgnoreCase( "-noValueMethods" ) ) {
                    valueMethods = false;
                    argv[i] = null;
                }
                else if ( argv[i].equalsIgnoreCase( "-init" ) ) {
                    factory = false;
                    argv[i] = null;
            }
                else if ( argv[i].equalsIgnoreCase( "-factory" ) ) {
                    factory = true;
                    argv[i] = null;
        }
                else if ( argv[i].equalsIgnoreCase( "-idlfile" ) ) {
                    argv[i] = null;
                    if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                        idlFrom = argv[i];
                        argv[i] = null;
                        if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                            idlTo = argv[i];
                            argv[i] = null;
                            ifHash.put( idlFrom,idlTo );
                            continue nextArg;
    }
                    }
                    main.error("rmic.option.requires.argument", "-idlfile");
                    result = false;
                }
                else if ( argv[i].equalsIgnoreCase( "-idlmodule" ) ) {
                    argv[i] = null;
                    if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                        idlFrom = argv[i];
                        argv[i] = null;
                        if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                            idlTo = argv[i];
                            argv[i] = null;
                            imHash.put( idlFrom,idlTo );
                            continue nextArg;
                        }
                    }
                    main.error("rmic.option.requires.argument", "-idlmodule");
                    result = false;
                }


            }
        }
    }
    return result;
}
 
Example 12
Source File: StubGenerator.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Examine and consume command line arguments.
 * @param argv The command line arguments. Ignore null
 * and unknown arguments. Set each consumed argument to null.
 * @param error Report any errors using the main.error() methods.
 * @return true if no errors, false otherwise.
 */
public boolean parseArgs(String argv[], Main main) {
    Object marker = new Object() ;

    // Reset any cached options...

    reverseIDs = false;
    localStubs = true;
    useHash = true;
    stubBaseClass = DEFAULT_STUB_CLASS;
    //       tieBaseClass = DEFAULT_TIE_CLASS;
    transactionalObjects = new Hashtable() ;

    // Parse options...

    boolean result = super.parseArgs(argv,main);
    if (result) {
        for (int i = 0; i < argv.length; i++) {
            if (argv[i] != null) {
                String arg = argv[i].toLowerCase();
                if (arg.equals("-iiop")) {
                    argv[i] = null;
                } else if (arg.equals("-xreverseids")) {
                    reverseIDs = true;
                    argv[i] = null;
                } else if (arg.equals("-nolocalstubs")) {
                    localStubs = false;
                    argv[i] = null;
                } else if (arg.equals("-xnohash")) {
                    useHash = false;
                    argv[i] = null;
                } else if (argv[i].equals("-standardPackage")) {
                    standardPackage = true;
                    argv[i] = null;
                } else if (argv[i].equals("-emitPermissionCheck")) {
                    emitPermissionCheck = true;
                    argv[i] = null;
                } else if (arg.equals("-xstubbase")) {
                    argv[i] = null;
                    if (++i < argv.length && argv[i] != null && !argv[i].startsWith("-")) {
                        stubBaseClass = argv[i];
                        argv[i] = null;
                    } else {
                        main.error("rmic.option.requires.argument", "-Xstubbase");
                        result = false;
                    }
                } else if (arg.equals("-xtiebase")) {
                    argv[i] = null;
                    if (++i < argv.length && argv[i] != null && !argv[i].startsWith("-")) {
                        tieBaseClass = argv[i];
                        argv[i] = null;
                    } else {
                        main.error("rmic.option.requires.argument", "-Xtiebase");
                        result = false;
                    }
                } else if (arg.equals("-transactional" )) {
                    // Scan for the next non-flag argument.
                    // Assume that it is a class name and add it
                    // to the list of transactional classes.
                    for ( int ctr=i+1; ctr<argv.length; ctr++ ) {
                        if (argv[ctr].charAt(1) != '-') {
                            transactionalObjects.put( argv[ctr], marker ) ;
                            break ;
                        }
                    }
                    argv[i] = null;
                } else if (arg.equals( "-poa" )) {
                    POATie = true ;
                    argv[i] = null;
                }
            }
        }
    }
    if(POATie){
        tieBaseClass = DEFAULT_POA_TIE_CLASS;
    } else {
        tieBaseClass = DEFAULT_TIE_CLASS;
    }
    return result;
}
 
Example 13
Source File: IDLGenerator.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Examine and consume command line arguments.
 * @param argv The command line arguments. Ignore null
 * and unknown arguments. Set each consumed argument to null.
 * @param error Report any errors using the main.error() methods.
 * @return true if no errors, false otherwise.
 */
public boolean parseArgs(String argv[], Main main) {
    boolean result = super.parseArgs(argv,main);
    String idlFrom;
    String idlTo;
    if (result) {
    nextArg:
        for (int i = 0; i < argv.length; i++) {
            if (argv[i] != null) {
                if (argv[i].equalsIgnoreCase("-idl")) {
                    idl = true;
                    argv[i] = null;
                }
                else if ( argv[i].equalsIgnoreCase( "-valueMethods" ) ) {
                    valueMethods = true;
                    argv[i] = null;
                }
                else if ( argv[i].equalsIgnoreCase( "-noValueMethods" ) ) {
                    valueMethods = false;
                    argv[i] = null;
                }
                else if ( argv[i].equalsIgnoreCase( "-init" ) ) {
                    factory = false;
                    argv[i] = null;
            }
                else if ( argv[i].equalsIgnoreCase( "-factory" ) ) {
                    factory = true;
                    argv[i] = null;
        }
                else if ( argv[i].equalsIgnoreCase( "-idlfile" ) ) {
                    argv[i] = null;
                    if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                        idlFrom = argv[i];
                        argv[i] = null;
                        if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                            idlTo = argv[i];
                            argv[i] = null;
                            ifHash.put( idlFrom,idlTo );
                            continue nextArg;
    }
                    }
                    main.error("rmic.option.requires.argument", "-idlfile");
                    result = false;
                }
                else if ( argv[i].equalsIgnoreCase( "-idlmodule" ) ) {
                    argv[i] = null;
                    if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                        idlFrom = argv[i];
                        argv[i] = null;
                        if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                            idlTo = argv[i];
                            argv[i] = null;
                            imHash.put( idlFrom,idlTo );
                            continue nextArg;
                        }
                    }
                    main.error("rmic.option.requires.argument", "-idlmodule");
                    result = false;
                }


            }
        }
    }
    return result;
}
 
Example 14
Source File: StubGenerator.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Examine and consume command line arguments.
 * @param argv The command line arguments. Ignore null
 * and unknown arguments. Set each consumed argument to null.
 * @param error Report any errors using the main.error() methods.
 * @return true if no errors, false otherwise.
 */
public boolean parseArgs(String argv[], Main main) {
    Object marker = new Object() ;

    // Reset any cached options...

    reverseIDs = false;
    localStubs = true;
    useHash = true;
    stubBaseClass = DEFAULT_STUB_CLASS;
    //       tieBaseClass = DEFAULT_TIE_CLASS;
    transactionalObjects = new Hashtable() ;

    // Parse options...

    boolean result = super.parseArgs(argv,main);
    if (result) {
        for (int i = 0; i < argv.length; i++) {
            if (argv[i] != null) {
                String arg = argv[i].toLowerCase();
                if (arg.equals("-iiop")) {
                    argv[i] = null;
                } else if (arg.equals("-xreverseids")) {
                    reverseIDs = true;
                    argv[i] = null;
                } else if (arg.equals("-nolocalstubs")) {
                    localStubs = false;
                    argv[i] = null;
                } else if (arg.equals("-xnohash")) {
                    useHash = false;
                    argv[i] = null;
                } else if (argv[i].equals("-standardPackage")) {
                    standardPackage = true;
                    argv[i] = null;
                } else if (argv[i].equals("-emitPermissionCheck")) {
                    emitPermissionCheck = true;
                    argv[i] = null;
                } else if (arg.equals("-xstubbase")) {
                    argv[i] = null;
                    if (++i < argv.length && argv[i] != null && !argv[i].startsWith("-")) {
                        stubBaseClass = argv[i];
                        argv[i] = null;
                    } else {
                        main.error("rmic.option.requires.argument", "-Xstubbase");
                        result = false;
                    }
                } else if (arg.equals("-xtiebase")) {
                    argv[i] = null;
                    if (++i < argv.length && argv[i] != null && !argv[i].startsWith("-")) {
                        tieBaseClass = argv[i];
                        argv[i] = null;
                    } else {
                        main.error("rmic.option.requires.argument", "-Xtiebase");
                        result = false;
                    }
                } else if (arg.equals("-transactional" )) {
                    // Scan for the next non-flag argument.
                    // Assume that it is a class name and add it
                    // to the list of transactional classes.
                    for ( int ctr=i+1; ctr<argv.length; ctr++ ) {
                        if (argv[ctr].charAt(1) != '-') {
                            transactionalObjects.put( argv[ctr], marker ) ;
                            break ;
                        }
                    }
                    argv[i] = null;
                } else if (arg.equals( "-poa" )) {
                    POATie = true ;
                    argv[i] = null;
                }
            }
        }
    }
    if(POATie){
        tieBaseClass = DEFAULT_POA_TIE_CLASS;
    } else {
        tieBaseClass = DEFAULT_TIE_CLASS;
    }
    return result;
}
 
Example 15
Source File: IDLGenerator.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Examine and consume command line arguments.
 * @param argv The command line arguments. Ignore null
 * and unknown arguments. Set each consumed argument to null.
 * @param error Report any errors using the main.error() methods.
 * @return true if no errors, false otherwise.
 */
public boolean parseArgs(String argv[], Main main) {
    boolean result = super.parseArgs(argv,main);
    String idlFrom;
    String idlTo;
    if (result) {
    nextArg:
        for (int i = 0; i < argv.length; i++) {
            if (argv[i] != null) {
                if (argv[i].equalsIgnoreCase("-idl")) {
                    idl = true;
                    argv[i] = null;
                }
                else if ( argv[i].equalsIgnoreCase( "-valueMethods" ) ) {
                    valueMethods = true;
                    argv[i] = null;
                }
                else if ( argv[i].equalsIgnoreCase( "-noValueMethods" ) ) {
                    valueMethods = false;
                    argv[i] = null;
                }
                else if ( argv[i].equalsIgnoreCase( "-init" ) ) {
                    factory = false;
                    argv[i] = null;
            }
                else if ( argv[i].equalsIgnoreCase( "-factory" ) ) {
                    factory = true;
                    argv[i] = null;
        }
                else if ( argv[i].equalsIgnoreCase( "-idlfile" ) ) {
                    argv[i] = null;
                    if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                        idlFrom = argv[i];
                        argv[i] = null;
                        if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                            idlTo = argv[i];
                            argv[i] = null;
                            ifHash.put( idlFrom,idlTo );
                            continue nextArg;
    }
                    }
                    main.error("rmic.option.requires.argument", "-idlfile");
                    result = false;
                }
                else if ( argv[i].equalsIgnoreCase( "-idlmodule" ) ) {
                    argv[i] = null;
                    if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                        idlFrom = argv[i];
                        argv[i] = null;
                        if ( ++i < argv.length && argv[i] != null && !argv[i].startsWith("-") ) {
                            idlTo = argv[i];
                            argv[i] = null;
                            imHash.put( idlFrom,idlTo );
                            continue nextArg;
                        }
                    }
                    main.error("rmic.option.requires.argument", "-idlmodule");
                    result = false;
                }


            }
        }
    }
    return result;
}
 
Example 16
Source File: StubGenerator.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Examine and consume command line arguments.
 * @param argv The command line arguments. Ignore null
 * and unknown arguments. Set each consumed argument to null.
 * @param error Report any errors using the main.error() methods.
 * @return true if no errors, false otherwise.
 */
public boolean parseArgs(String argv[], Main main) {
    Object marker = new Object() ;

    // Reset any cached options...

    reverseIDs = false;
    localStubs = true;
    useHash = true;
    stubBaseClass = DEFAULT_STUB_CLASS;
    //       tieBaseClass = DEFAULT_TIE_CLASS;
    transactionalObjects = new Hashtable() ;

    // Parse options...

    boolean result = super.parseArgs(argv,main);
    if (result) {
        for (int i = 0; i < argv.length; i++) {
            if (argv[i] != null) {
                String arg = argv[i].toLowerCase();
                if (arg.equals("-iiop")) {
                    argv[i] = null;
                } else if (arg.equals("-xreverseids")) {
                    reverseIDs = true;
                    argv[i] = null;
                } else if (arg.equals("-nolocalstubs")) {
                    localStubs = false;
                    argv[i] = null;
                } else if (arg.equals("-xnohash")) {
                    useHash = false;
                    argv[i] = null;
                } else if (argv[i].equals("-standardPackage")) {
                    standardPackage = true;
                    argv[i] = null;
                } else if (argv[i].equals("-emitPermissionCheck")) {
                    emitPermissionCheck = true;
                    argv[i] = null;
                } else if (arg.equals("-xstubbase")) {
                    argv[i] = null;
                    if (++i < argv.length && argv[i] != null && !argv[i].startsWith("-")) {
                        stubBaseClass = argv[i];
                        argv[i] = null;
                    } else {
                        main.error("rmic.option.requires.argument", "-Xstubbase");
                        result = false;
                    }
                } else if (arg.equals("-xtiebase")) {
                    argv[i] = null;
                    if (++i < argv.length && argv[i] != null && !argv[i].startsWith("-")) {
                        tieBaseClass = argv[i];
                        argv[i] = null;
                    } else {
                        main.error("rmic.option.requires.argument", "-Xtiebase");
                        result = false;
                    }
                } else if (arg.equals("-transactional" )) {
                    // Scan for the next non-flag argument.
                    // Assume that it is a class name and add it
                    // to the list of transactional classes.
                    for ( int ctr=i+1; ctr<argv.length; ctr++ ) {
                        if (argv[ctr].charAt(1) != '-') {
                            transactionalObjects.put( argv[ctr], marker ) ;
                            break ;
                        }
                    }
                    argv[i] = null;
                } else if (arg.equals( "-poa" )) {
                    POATie = true ;
                    argv[i] = null;
                }
            }
        }
    }
    if(POATie){
        tieBaseClass = DEFAULT_POA_TIE_CLASS;
    } else {
        tieBaseClass = DEFAULT_TIE_CLASS;
    }
    return result;
}