8251374: jmap -dump could accept invalid options

Emit usage(1) in dump() argument loop

Reviewed-by: sspitsyn, phh
This commit is contained in:
Lin Zang 2020-08-13 13:57:12 -07:00
parent 0db838628c
commit 7638580477

View File

@ -216,6 +216,11 @@ public class JMap {
liveopt = "-live";
} else if (subopt.startsWith("file=")) {
filename = parseFileName(subopt);
} else if (subopt.equals("format=b")) {
// ignore format (not needed at this time)
} else {
System.err.println("Fail: invalid option: '" + subopt + "'");
usage(1);
}
}