{"record":{"id":"1b34501868300d25","repo":"apache/hadoop","slug":"invalid-null-argument","errorCode":null,"errorMessage":"Invalid null argument","messagePattern":"Invalid null argument","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/find/NumberExpression.java","lineNumber":84,"sourceCode":"\n  protected void setMode(MODE mode) {\n    this.mode = mode;\n  }\n\n  @Override\n  public void prepare() throws IOException {\n    parseArgument(getArgument(1));\n  }\n\n  /**\n   * Parse the argument string to extract the numeric argument.\n   *\n   * @param arg String to be parsed\n   * @throws IllegalArgumentException if there is a problem parsing the argument\n   */\n  protected void parseArgument(String arg) throws IllegalArgumentException {\n    if (arg == null) {\n      throw new IllegalArgumentException(\"Invalid null argument\");\n    } else if (arg.isEmpty()) {\n      throw new IllegalArgumentException(\"Invalid empty argument\");\n    }\n    switch (mode) {\n    case ROUND_UP:\n      if (arg.startsWith(\"+\")) {\n        min = (Long.parseLong(arg.substring(1)) * units) + 1L;\n      } else if (arg.startsWith(\"-\")) {\n        max = (Long.parseLong(arg.substring(1)) * units) - units;\n      } else {\n        max = Long.parseLong(arg) * units;\n        min = max - units + 1L;\n      }\n      break;\n    case ROUND_DOWN:\n      if (arg.startsWith(\"+\")) {\n        min = (Long.parseLong(arg.substring(1)) * units) + units;\n      } else if (arg.startsWith(\"-\")) {","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/find/NumberExpression.java#L66-L102","documentation":"Error \"Invalid null argument\" thrown in apache/hadoop.","triggerScenarios":"Thrown by find numeric expressions (e.g. -size, -mtime) when a null argument is passed where a number is required.","commonSituations":"See trigger scenarios.","solutions":["Provide a numeric argument for the find numeric expression (e.g. -size, -mtime).","Check that the argument is not null before parsing."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}