{"record":{"id":"fce959b2ef0605f1","repo":"juicedata/juicefs","slug":"no-sources-given","errorCode":null,"errorMessage":"No sources given","messagePattern":"No sources given","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdk/java/src/main/java/io/juicefs/JuiceFileSystemImpl.java","lineNumber":1607,"sourceCode":"    } else {\n      return new MD5MD5CRC32GzipFileChecksum(bytesPerCrc, crcPerBlock, md5);\n    }\n  }\n\n  @Override\n  public void concat(final Path dst, final Path[] srcs) throws IOException {\n    if (needCheckPermission()) {\n      access(dst.getParent(), FsAction.WRITE);\n      access(dst, FsAction.WRITE);\n      for (Path src : srcs) {\n        access(src, FsAction.READ);\n      }\n      superGroupFileSystem.concat(dst, srcs);\n      return;\n    }\n    statistics.incrementWriteOps(1);\n    if (srcs.length == 0) {\n      throw new IllegalArgumentException(\"No sources given\");\n    }\n    Path dp = makeQualified(dst).getParent();\n    for (Path src : srcs) {\n      if (!makeQualified(src).getParent().equals(dp)) {\n        throw new HadoopIllegalArgumentException(\"Source file \" + normalizePath(src)\n                + \" is not in the same directory with the target \"\n                + normalizePath(dst));\n      }\n    }\n    byte[][] srcbytes = new byte[srcs.length][];\n    int bufsize = 0;\n    for (int i = 0; i < srcs.length; i++) {\n      srcbytes[i] = normalizePath(srcs[i]).getBytes(\"UTF-8\");\n      bufsize += srcbytes[i].length + 1;\n    }\n    Pointer buf = Memory.allocate(Runtime.getRuntime(lib), bufsize);\n    long offset = 0;\n    for (int i = 0; i < srcs.length; i++) {","sourceCodeStart":1589,"sourceCodeEnd":1625,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/sdk/java/src/main/java/io/juicefs/JuiceFileSystemImpl.java#L1589-L1625","documentation":"Thrown by concat() when the srcs array is empty. Concatenating zero source files is meaningless, so the method validates input before making the native jfs_concat call and fails fast with IllegalArgumentException.","triggerScenarios":"fs.concat(dst, new Path[0]); building the source list with a filter that removed all entries; passing a null- or empty-sized collection converted to an array.","commonSituations":"Batch jobs where all source files were already consumed/deleted by a previous run; incorrect partition handling yielding no parts to merge; copy-paste bug passing wrong variable.","solutions":["Guard the call: if (srcs.length > 0) fs.concat(dst, srcs)","Skip concat entirely (and create an empty dst) when no sources exist","Fix the upstream filtering that emptied the source list","Log the source list before concat to catch empty input early"],"exampleFix":"// before\nfs.concat(dst, srcs);\n// after\nif (srcs != null && srcs.length > 0) { fs.concat(dst, srcs); }","handlingStrategy":"validation","validationCode":"if (srcs == null || srcs.length == 0) throw new IllegalArgumentException(\"concat requires at least one source\");","typeGuard":"boolean hasSources(Path[] srcs) { return srcs != null && srcs.length > 0; }","tryCatchPattern":null,"preventionTips":["Always build and log the source list before concat","Handle the zero-partition case explicitly","Assert non-empty input at job setup"],"tags":["java","hadoop","validation"],"backgroundTag":"missing-required-argument","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}