{"record":{"id":"fcb369f2536e5676","repo":"apache/hadoop","slug":"invalid-inputs-length-fcb369","errorCode":null,"errorMessage":"Invalid inputs length","messagePattern":"Invalid inputs length","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/DecodingState.java","lineNumber":42,"sourceCode":" * A utility class that maintains decoding state during a decode call.\n */\n@InterfaceAudience.Private\nclass DecodingState {\n  RawErasureDecoder decoder;\n  int decodeLength;\n\n  /**\n   * Check and validate decoding parameters, throw exception accordingly. The\n   * checking assumes it's a MDS code. Other code  can override this.\n   * @param inputs input buffers to check\n   * @param erasedIndexes indexes of erased units in the inputs array\n   * @param outputs output buffers to check\n   */\n  <T> void checkParameters(T[] inputs, int[] erasedIndexes,\n                           T[] outputs) {\n    if (inputs.length != decoder.getNumParityUnits() +\n        decoder.getNumDataUnits()) {\n      throw new IllegalArgumentException(\"Invalid inputs length\");\n    }\n\n    if (erasedIndexes.length != outputs.length) {\n      throw new HadoopIllegalArgumentException(\n          \"erasedIndexes and outputs mismatch in length\");\n    }\n\n    if (erasedIndexes.length > decoder.getNumParityUnits()) {\n      throw new HadoopIllegalArgumentException(\n          \"Too many erased, not recoverable\");\n    }\n  }\n}\n","sourceCodeStart":24,"sourceCodeEnd":56,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/DecodingState.java#L24-L56","documentation":"Error \"Invalid inputs length\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/DecodingState.java:42 when the library encounters an invalid state.","commonSituations":"Occurs when the inputs array length does not match numDataUnits + numParityUnits for a decoding call. Construct input arrays of exactly the expected length.","solutions":["Pass inputs length equal to numDataUnits + numParityUnits as required by the decoding state.","Verify the schema's unit counts match the arrays supplied by the caller."],"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"}