From a7b730f12731321275cf6902e4882397a5cc82a5 Mon Sep 17 00:00:00 2001 From: Xueming Shen Date: Mon, 24 May 2010 15:20:23 -0400 Subject: [PATCH] 4690407: JAR tool: option -i can't be combined with other options -i can't combined with cxut, do sanity check on options Reviewed-by: martin --- jdk/src/share/classes/sun/tools/jar/Main.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/jdk/src/share/classes/sun/tools/jar/Main.java b/jdk/src/share/classes/sun/tools/jar/Main.java index 404d5cdedc2..db269fd5247 100644 --- a/jdk/src/share/classes/sun/tools/jar/Main.java +++ b/jdk/src/share/classes/sun/tools/jar/Main.java @@ -306,28 +306,28 @@ class Main { 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 @@ class Main { 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;