{"record":{"id":"b41076c77dca670c","repo":"apache/hadoop","slug":"key-can-not-be-null-b41076","errorCode":null,"errorMessage":"Key can not be null","messagePattern":"Key can not be null","errorType":"exception","errorClass":"NullPointerException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/bloom/DynamicBloomFilter.java","lineNumber":139,"sourceCode":"   * @param hashType type of the hashing function (see\n   * {@link org.apache.hadoop.util.hash.Hash}).\n   * @param nr The threshold for the maximum number of keys to record in a\n   * dynamic Bloom filter row.\n   */\n  public DynamicBloomFilter(int vectorSize, int nbHash, int hashType, int nr) {\n    super(vectorSize, nbHash, hashType);\n\n    this.nr = nr;\n    this.currentNbRecord = 0;\n\n    matrix = new BloomFilter[1];\n    matrix[0] = new BloomFilter(this.vectorSize, this.nbHash, this.hashType);\n  }\n\n  @Override\n  public void add(Key key) {\n    if (key == null) {\n      throw new NullPointerException(\"Key can not be null\");\n    }\n\n    BloomFilter bf = getActiveStandardBF();\n\n    if (bf == null) {\n      addRow();\n      bf = matrix[matrix.length - 1];\n      currentNbRecord = 0;\n    }\n\n    bf.add(key);\n\n    currentNbRecord++;\n  }\n\n  @Override\n  public void and(Filter filter) {\n    if (filter == null","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/bloom/DynamicBloomFilter.java#L121-L157","documentation":"Error \"Key can not be null\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/bloom/DynamicBloomFilter.java:139 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a non-null Key to the DynamicBloomFilter operation. Guard the call site against null keys."],"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"}