From ea5aa61c8cc5caa04f7c7eac9634df28011581dc Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Thu, 31 Aug 2023 16:10:44 +0000 Subject: [PATCH] 8315383: jlink SystemModulesPlugin incorrectly parses the options Reviewed-by: mchung --- .../tools/jlink/internal/plugins/SystemModulesPlugin.java | 2 +- test/jdk/tools/jlink/JLinkDedupTestBatchSizeOne.java | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModulesPlugin.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModulesPlugin.java index 77ba8c063e8..ff55f812d91 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModulesPlugin.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModulesPlugin.java @@ -148,7 +148,7 @@ public final class SystemModulesPlugin extends AbstractPlugin { if (split.length != 2) { throw new IllegalArgumentException(getName() + ": " + arg); } - if (split[0].equals("batch-size")) { + if (!split[0].equals("batch-size")) { throw new IllegalArgumentException(getName() + ": " + arg); } this.moduleDescriptorsPerMethod = Integer.parseInt(split[1]); diff --git a/test/jdk/tools/jlink/JLinkDedupTestBatchSizeOne.java b/test/jdk/tools/jlink/JLinkDedupTestBatchSizeOne.java index a8c8010ab3e..3a52f6b32c4 100644 --- a/test/jdk/tools/jlink/JLinkDedupTestBatchSizeOne.java +++ b/test/jdk/tools/jlink/JLinkDedupTestBatchSizeOne.java @@ -21,12 +21,8 @@ * questions. */ -import jdk.test.lib.JDKToolLauncher; import jdk.test.lib.compiler.CompilerUtils; -import jdk.test.lib.process.OutputAnalyzer; -import jdk.test.lib.process.ProcessTools; import tests.JImageGenerator; -import tests.Result; import java.io.File; import java.nio.file.Files; @@ -94,7 +90,7 @@ public class JLinkDedupTestBatchSizeOne { .addMods("m2") .addMods("m3") .addMods("m4") - .option("--system-modules=batchSize=1") + .option("--system-modules=batch-size=1") .call() .assertSuccess();