RFR: 8261131: jcmd jmap dump should not accept gz option with no value
Chris Plummer
cjplummer at openjdk.java.net
Thu Feb 4 23:33:48 UTC 2021
On Thu, 4 Feb 2021 07:11:19 GMT, Lin Zang <lzang at openjdk.org> wrote:
> 8261131: jcmd jmap dump should not accept gz option with no value
Copyrights needs updating in both files.
src/jdk.jcmd/share/classes/sun/tools/jmap/JMap.java line 230:
> 228: } else if (subopt.startsWith("gz=")) {
> 229: compress_level = subopt.substring("gz=".length());
> 230: if (compress_level == null || compress_level.length() == 0) {
I don't think `substring` can return `null`, so the proper fix was to remove the null check and replace with your check for `== 0`.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2399
More information about the serviceability-dev
mailing list