{"record":{"id":"440c773a9376f1a3","repo":"apache/hadoop","slug":"write-b-b-length-off-len-440c77","errorCode":null,"errorMessage":"write (b[{b.length}], {off}, {len})","messagePattern":"write \\(b\\[(.+?)\\], (.+?), (.+?)\\)","errorType":"exception","errorClass":"IndexOutOfBoundsException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/OSSDataBlocks.java","lineNumber":72,"sourceCode":"\n  private OSSDataBlocks() {\n  }\n\n  /**\n   * Validate args to a write command. These are the same validation checks\n   * expected for any implementation of {@code OutputStream.write()}.\n   * @param b byte array containing data\n   * @param off offset in array where to start\n   * @param len number of bytes to be written\n   * @throws NullPointerException for a null buffer\n   * @throws IndexOutOfBoundsException if indices are out of range\n   */\n  static void validateWriteArgs(byte[] b, int off, int len)\n      throws IOException {\n    Preconditions.checkNotNull(b);\n    if ((off < 0) || (off > b.length) || (len < 0) ||\n        ((off + len) > b.length) || ((off + len) < 0)) {\n      throw new IndexOutOfBoundsException(\n          \"write (b[\" + b.length + \"], \" + off + \", \" + len + ')');\n    }\n  }\n\n  /**\n   * Create a factory.\n   * @param owner factory owner\n   * @param name factory name -the option from {@link Constants}.\n   * @return the factory, ready to be initialized.\n   * @throws IllegalArgumentException if the name is unknown.\n   */\n  static BlockFactory createFactory(AliyunOSSFileSystem owner,\n      String name) {\n    switch (name) {\n    case Constants.FAST_UPLOAD_BUFFER_ARRAY:\n      return new ArrayBlockFactory(owner);\n    case Constants.FAST_UPLOAD_BUFFER_DISK:\n      return new DiskBlockFactory(owner);","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/OSSDataBlocks.java#L54-L90","documentation":"Error \"write (b[{b.length}], {off}, {len})\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/OSSDataBlocks.java:72 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check buffer write arguments: offset and length must be within the bounds of the byte array passed to write()."],"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"}