{"record":{"id":"a941f34bd7ee8577","repo":"apache/hadoop","slug":"invalid-arguments-to-createhardlinkmult-filename","errorCode":null,"errorMessage":"invalid arguments to createHardLinkMult: filename list can be empty but not null","messagePattern":"invalid arguments to createHardLinkMult: filename list can be empty but not null","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/HardLink.java","lineNumber":203,"sourceCode":"   * directory, into one target directory.\n   * @param parentDir - directory containing source files\n   * @param fileBaseNames - list of path-less file names, as returned by \n   *                        parentDir.list()\n   * @param linkDir - where the hardlinks should be put. It must already exist.\n   * @throws IOException raised on errors performing I/O.\n   */\n  public static void createHardLinkMult(File parentDir, String[] fileBaseNames,\n      File linkDir) throws IOException {\n    if (parentDir == null) {\n      throw new IOException(\n          \"invalid arguments to createHardLinkMult: parent directory is null\");\n    }\n    if (linkDir == null) {\n      throw new IOException(\n          \"invalid arguments to createHardLinkMult: link directory is null\");\n    }\n    if (fileBaseNames == null) {\n      throw new IOException(\n          \"invalid arguments to createHardLinkMult: \"\n          + \"filename list can be empty but not null\");\n    }\n    if (!linkDir.exists()) {\n      throw new FileNotFoundException(linkDir + \" not found.\");\n    }\n    for (String name : fileBaseNames) {\n      createLink(linkDir.toPath().resolve(name),\n                 parentDir.toPath().resolve(name));\n    }\n  }\n\n    /**\n     * Determines whether the system supports hardlinks.\n     * @param f - file to examine\n     * @return true if hardlinks are supported, false otherwise\n     */\n  public static boolean supportsHardLink(File f) {","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/HardLink.java#L185-L221","documentation":"Error \"invalid arguments to createHardLinkMult: filename list can be empty but not null\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/HardLink.java:203 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass an empty array instead of null for the filename list.","Initialize the filename list before calling createHardLinkMult."],"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-23T01:17:44.959Z"}