changeset 2411:6df25b528926

4690407: JAR tool: option -i can't be combined with other options Summary: -i can't combined with cxut, do sanity check on options Reviewed-by: martin
author sherman
date Mon, 24 May 2010 15:20:23 -0400
parents 41a5722e6e10
children d1cf79e27365
files src/share/classes/sun/tools/jar/Main.java
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/tools/jar/Main.java	Mon May 24 00:39:57 2010 -0400
+++ b/src/share/classes/sun/tools/jar/Main.java	Mon May 24 15:20:23 2010 -0400
@@ -306,28 +306,28 @@
             for (int i = 0; i < flags.length(); i++) {
                 switch (flags.charAt(i)) {
                 case 'c':
-                    if (xflag || tflag || uflag) {
+                    if (xflag || tflag || uflag || iflag) {
                         usageError();
                         return false;
                     }
                     cflag = true;
                     break;
                 case 'u':
-                    if (cflag || xflag || tflag) {
+                    if (cflag || xflag || tflag || iflag) {
                         usageError();
                         return false;
                     }
                     uflag = true;
                     break;
                 case 'x':
-                    if (cflag || uflag || tflag) {
+                    if (cflag || uflag || tflag || iflag) {
                         usageError();
                         return false;
                     }
                     xflag = true;
                     break;
                 case 't':
-                    if (cflag || uflag || xflag) {
+                    if (cflag || uflag || xflag || iflag) {
                         usageError();
                         return false;
                     }
@@ -349,6 +349,10 @@
                     flag0 = true;
                     break;
                 case 'i':
+                    if (cflag || uflag || xflag || tflag) {
+                        usageError();
+                        return false;
+                    }
                     // do not increase the counter, files will contain rootjar
                     rootjar = args[count++];
                     iflag = true;