{"record":{"id":"f614a04a2d075cf8","repo":"apache/hadoop","slug":"nbhash-must-be-0","errorCode":null,"errorMessage":"nbHash must be > 0","messagePattern":"nbHash must be > 0","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/bloom/HashFunction.java","lineNumber":89,"sourceCode":"\n  /** Hashing algorithm to use. */\n  private Hash hashFunction;\n  \n  /**\n   * Constructor.\n   * <p>\n   * Builds a hash function that must obey to a given maximum number of returned values and a highest value.\n   * @param maxValue The maximum highest returned value.\n   * @param nbHash The number of resulting hashed values.\n   * @param hashType type of the hashing function (see {@link Hash}).\n   */\n  public HashFunction(int maxValue, int nbHash, int hashType) {\n    if (maxValue <= 0) {\n      throw new IllegalArgumentException(\"maxValue must be > 0\");\n    }\n    \n    if (nbHash <= 0) {\n      throw new IllegalArgumentException(\"nbHash must be > 0\");\n    }\n\n    this.maxValue = maxValue;\n    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   */","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/bloom/HashFunction.java#L71-L107","documentation":"Error \"nbHash must be > 0\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/bloom/HashFunction.java:89 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["nbHash must be positive. Construct the HashFunction with at least one hash function."],"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-23T01:17:44.959Z"}