{"record":{"id":"323bf11cd3c0e06e","repo":"apache/flink","slug":"pos-323bf1","errorCode":null,"errorMessage":"{pos}","messagePattern":"\\{pos\\}","errorType":"exception","errorClass":"IndexOutOfBoundsException","httpStatus":null,"severity":"error","filePath":"flink-core-api/src/main/java/org/apache/flink/api/java/tuple/Tuple8.java","lineNumber":137,"sourceCode":"        switch (pos) {\n            case 0:\n                return (T) this.f0;\n            case 1:\n                return (T) this.f1;\n            case 2:\n                return (T) this.f2;\n            case 3:\n                return (T) this.f3;\n            case 4:\n                return (T) this.f4;\n            case 5:\n                return (T) this.f5;\n            case 6:\n                return (T) this.f6;\n            case 7:\n                return (T) this.f7;\n            default:\n                throw new IndexOutOfBoundsException(String.valueOf(pos));\n        }\n    }\n\n    @Override\n    @SuppressWarnings(\"unchecked\")\n    public <T> void setField(T value, int pos) {\n        switch (pos) {\n            case 0:\n                this.f0 = (T0) value;\n                break;\n            case 1:\n                this.f1 = (T1) value;\n                break;\n            case 2:\n                this.f2 = (T2) value;\n                break;\n            case 3:\n                this.f3 = (T3) value;","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core-api/src/main/java/org/apache/flink/api/java/tuple/Tuple8.java#L119-L155","documentation":"Tuple8.getField(int pos) throws IndexOutOfBoundsException when pos is outside 0..7. Tuple8 is the largest Java tuple arity Flink ships, so code that assumed a bigger tuple fails here first. The message is the invalid position.","triggerScenarios":"getField(8) or a negative index; widening a schema past eight fields but still using Tuple8 with unclamped positions; 1-based indices passed as 0-based.","commonSituations":"A record type grows to 9+ fields while positional access code still assumes 8 is valid; projection lists reused across tuple sizes; off-by-one iteration.","solutions":["Use positions 0..7 for Tuple8.getField","If you need more than 8 fields, switch to Tuple9, a POJO, or a Row instead of indexing past the arity","Bounds-check with tuple.getArity() before positional access","Access typed fields (tuple.f0..tuple.f7) directly when the position is static"],"exampleFix":"// before\nObject v = tuple8.getField(8);\n\n// after\nObject v = (pos >= 0 && pos < tuple8.getArity()) ? tuple8.getField(pos) : null;","handlingStrategy":"validation","validationCode":"if (pos < 0 || pos >= tuple8.getArity()) {\n    throw new IllegalArgumentException(\"pos \" + pos + \" outside Tuple8 arity 8\");\n}\nObject v = tuple8.getField(pos);","typeGuard":null,"tryCatchPattern":"catch (IndexOutOfBoundsException e) { /* pos in message; rethrow with the projection/schema it came from */ }","preventionTips":["Positions 0..7 only; there is no field 8 on Tuple8","If a schema needs more than 8 fields, switch to Tuple9/POJO/Row deliberately and update positional code","Bounds-check indices from Table/SQL projections against the tuple arity"],"tags":["tuple","index-out-of-bounds","flink-core-api","validation"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}