< prev index next >

src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/ap/Options.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -56,15 +56,11 @@
     public final List<String> arguments = new ArrayList<String>();
 
     public void parseArguments(String[] args) throws BadCommandLineException {
         for (int i = 0 ; i <args.length; i++) {
             if (args[i].charAt(0)== '-') {
-                int j = parseArgument(args,i);
-                if(j==0)
-                    throw new BadCommandLineException(
-                            Messages.UNRECOGNIZED_PARAMETER.format(args[i]));
-                i += j;
+                i += parseArgument(args, i);
             } else {
                 arguments.add(args[i]);
             }
         }
     }

@@ -88,15 +84,12 @@
             episodeFile = new File(args[++i]);
             return 1;
         }
 
         if (args[i].equals(DISABLE_XML_SECURITY)) {
-            if (i == args.length - 1)
-                throw new BadCommandLineException(
-                        (Messages.OPERAND_MISSING.format(args[i])));
             disableXmlSecurity = true;
-            return 1;
+            return 0;
         }
 
         if (args[i].equals("-encoding")) {
             if (i == args.length - 1)
                 throw new BadCommandLineException(

@@ -112,12 +105,12 @@
             classpath = args[++i];
 
             return 1;
         }
 
-        return 0;
-
+        throw new BadCommandLineException(
+                Messages.UNRECOGNIZED_PARAMETER.format(args[i]));
     }
 
     /**
      * @return the disableXmlSecurity
      */
< prev index next >