{"record":{"id":"98666a5246d06e32","repo":"apache/hadoop","slug":"buffer-reference-is-null","errorCode":null,"errorMessage":"buffer reference is null","messagePattern":"buffer reference is null","errorType":"validation","errorClass":"NullPointerException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/bloom/HashFunction.java","lineNumber":111,"sourceCode":"    this.nbHash = nbHash;\n    this.hashFunction = Hash.getInstance(hashType);\n    if (this.hashFunction == null)\n      throw new IllegalArgumentException(\"hashType must be known\");\n  }\n\n  /** Clears <i>this</i> hash function. A NOOP */\n  public void clear() {\n  }\n\n  /**\n   * Hashes a specified key into several integers.\n   * @param k The specified key.\n   * @return The array of hashed values.\n   */\n  public int[] hash(Key k){\n      byte[] b = k.getBytes();\n      if (b == null) {\n        throw new NullPointerException(\"buffer reference is null\");\n      }\n      if (b.length == 0) {\n        throw new IllegalArgumentException(\"key length must be > 0\");\n      }\n      int[] result = new int[nbHash];\n      for (int i = 0, initval = 0; i < nbHash; i++) {\n\t  initval = hashFunction.hash(b, initval);\n\t  result[i] = Math.abs(initval % maxValue);\n      }\n      return result;\n  }\n}","sourceCodeStart":93,"sourceCodeEnd":123,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/bloom/HashFunction.java#L93-L123","documentation":"Error \"buffer reference is null\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/bloom/HashFunction.java:111 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The ByteBuffer passed to hash() is null. Provide a non-null buffer containing the key bytes."],"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"}