You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by il...@apache.org on 2021/04/15 15:06:29 UTC
[ignite] branch master updated: IGNITE-14547 Fix NPE in control.sh
if there is illegal parameter after --cache indexes_force_rebuild - Fixes
#9005.
This is an automated email from the ASF dual-hosted git repository.
ilyak pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push:
new ed876a6 IGNITE-14547 Fix NPE in control.sh if there is illegal parameter after --cache indexes_force_rebuild - Fixes #9005.
ed876a6 is described below
commit ed876a600cecfc428f0de5399b5932ce16f6808d
Author: Ilya Kazakov <ka...@gmail.com>
AuthorDate: Thu Apr 15 18:05:59 2021 +0300
IGNITE-14547 Fix NPE in control.sh if there is illegal parameter after --cache indexes_force_rebuild - Fixes #9005.
Signed-off-by: Ilya Kasnacheev <il...@gmail.com>
---
.../internal/commandline/cache/CacheIndexesForceRebuild.java | 2 +-
.../ignite/util/GridCommandHandlerIndexForceRebuildTest.java | 9 +++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/cache/CacheIndexesForceRebuild.java b/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/cache/CacheIndexesForceRebuild.java
index c1415ce..8901277 100644
--- a/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/cache/CacheIndexesForceRebuild.java
+++ b/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/cache/CacheIndexesForceRebuild.java
@@ -207,7 +207,7 @@ public class CacheIndexesForceRebuild extends AbstractCommand<CacheIndexesForceR
IndexForceRebuildCommandArg arg = CommandArgUtils.of(nextArg, IndexForceRebuildCommandArg.class);
if (arg == null)
- throw new IllegalArgumentException("Unknown argument: " + arg.argName());
+ throw new IllegalArgumentException("Unknown argument: " + nextArg);
switch (arg) {
case NODE_ID:
diff --git a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexForceRebuildTest.java b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexForceRebuildTest.java
index 4d8b181..5cad551 100644
--- a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexForceRebuildTest.java
+++ b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexForceRebuildTest.java
@@ -301,6 +301,15 @@ public class GridCommandHandlerIndexForceRebuildTest extends GridCommandHandlerA
}
/**
+ * Checks illegal parameter after indexes_force_rebuild.
+ */
+ @Test
+ public void testIllegalArgument() {
+ int code = execute("--cache", "indexes_force_rebuild", "--illegal_parameter");
+ assertEquals(1, code);
+ }
+
+ /**
* Checks client node id as an agrument. Command shoul
*
* @throws Exception If failed to start client node.