You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2022/12/12 17:15:41 UTC

[GitHub] [hadoop] omalley commented on a diff in pull request #5195: HDFS-16856: Refactor RouterAdmin to use the AdminHelper class.

omalley commented on code in PR #5195:
URL: https://github.com/apache/hadoop/pull/5195#discussion_r1046122861


##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/StringUtils.java:
##########
@@ -1182,6 +1200,19 @@ public static String popFirstNonOption(List<String> args) {
     }
     return null;
   }
+  /**
+   * From a list of command-line arguments, ensure that all of the arguments
+   * have been used except a possible "--".
+   *
+   * @param args  List of arguments.
+   * @throws IllegalArgumentException if some arguments were not used
+   */
+  public static void ensureAllUsed(List<String> args) throws IllegalArgumentException {
+    if (!args.isEmpty() && !(args.size() == 1 && "--".equals(args.get(0)))) {

Review Comment:
   I find writing code that depends overly on knowing the precedence for non-math operators leads to trouble, so I'd prefer to leave them in.



-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org