nizhikov commented on code in PR #10710:
URL: https://github.com/apache/ignite/pull/10710#discussion_r1195359812


##########
modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/DeclarativeCommandAdapter.java:
##########
@@ -129,25 +128,27 @@ public 
DeclarativeCommandAdapter(org.apache.ignite.internal.management.api.Comma
             null
         );
 
+        Consumer<Field> namedArgCb =
+            fld -> namedArgs.add(toArg.apply(fld, 
fld.getAnnotation(Argument.class).optional()));
+
+        Consumer<Field> positionalArgCb = fld -> positionalArgs.add(new 
CLIArgument<>(
+            fld.getName(),
+            null,
+            fld.getAnnotation(Argument.class).optional(),
+            fld.getType(),
+            null
+        ));
+
         visitCommandParams(
             cmd0.argClass(),
-            fld -> positionalArgs.add(new CLIArgument<>(
-                fld.getName(),
-                null,
-                fld.getAnnotation(Argument.class).optional(),
-                fld.getType(),
-                null
-            )),
-            fld -> namedArgs.add(toArg.apply(fld, 
fld.getAnnotation(Argument.class).optional())),
-            (optionals, flds) -> {
-                List<CLIArgument<?>> oneOfArg = flds.stream().map(
-                    fld -> toArg.apply(fld, 
fld.getAnnotation(Argument.class).optional())
-                ).collect(Collectors.toList());
-
-                oneOfArgs.add(F.t(optionals, oneOfArg));
-
-                flds.forEach(fld -> namedArgs.add(toArg.apply(fld, true)));
-            }
+            positionalArgCb,
+            namedArgCb,
+            (argGrp, flds) -> flds.forEach(fld -> {

Review Comment:
   Extracted to variable



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to