{"record":{"id":"67e8eaf652cd44e8","repo":"apache/hadoop","slug":"invalid-arguments-to-createhardlink-source-file-i","errorCode":null,"errorMessage":"invalid arguments to createHardLink: source file is null","messagePattern":"invalid arguments to createHardLink: source file is 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":173,"sourceCode":"    }\n  }\n\n  /*\n   * ****************************************************\n   * Complexity is above.  User-visible functionality is below\n   * ****************************************************\n   */\n\n  /**\n   * Creates a hardlink.\n   * @param file - existing source file\n   * @param linkName - desired target link file\n   * @throws IOException raised on errors performing I/O.\n   */\n  public static void createHardLink(File file, File linkName)\n      throws IOException {\n    if (file == null) {\n      throw new IOException(\n          \"invalid arguments to createHardLink: source file is null\");\n    }\n    if (linkName == null) {\n      throw new IOException(\n          \"invalid arguments to createHardLink: link name is null\");\n    }\n    createLink(linkName.toPath(), file.toPath());\n  }\n\n  /**\n   * Creates hardlinks from multiple existing files within one parent\n   * 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   */","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/HardLink.java#L155-L191","documentation":"Error \"invalid arguments to createHardLink: source file is null\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/HardLink.java:173 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a non-null source File to createHardLink.","Check the source file path construction before the call."],"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"}