{"record":{"id":"eba0fbf05addbf2d","repo":"apache/hadoop","slug":"maxvalue-must-be-0","errorCode":null,"errorMessage":"maxValue must be > 0","messagePattern":"maxValue 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":85,"sourceCode":"  private int nbHash;\n\n  /** The maximum highest returned value. */\n  private int maxValue;\n\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  /**","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/bloom/HashFunction.java#L67-L103","documentation":"Error \"maxValue 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:85 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["maxValue must be positive. Construct the HashFunction with maxValue > 0 (e.g. the filter's bit vector size)."],"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"}