{"record":{"id":"adcd2b918b0fed87","repo":"apache/flink","slug":"type-at-position-is-null","errorCode":null,"errorMessage":"Type at position {} is null.","messagePattern":"Type at position (.+?) is null\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink-core/src/main/java/org/apache/flink/api/java/typeutils/TupleTypeInfo.java","lineNumber":218,"sourceCode":"\n    @Override\n    public String toString() {\n        return \"Java \" + super.toString();\n    }\n\n    // --------------------------------------------------------------------------------------------\n\n    @PublicEvolving\n    public static <X extends Tuple> TupleTypeInfo<X> getBasicTupleTypeInfo(Class<?>... basicTypes) {\n        if (basicTypes == null || basicTypes.length == 0) {\n            throw new IllegalArgumentException();\n        }\n\n        TypeInformation<?>[] infos = new TypeInformation<?>[basicTypes.length];\n        for (int i = 0; i < infos.length; i++) {\n            Class<?> type = basicTypes[i];\n            if (type == null) {\n                throw new IllegalArgumentException(\"Type at position \" + i + \" is null.\");\n            }\n\n            TypeInformation<?> info = BasicTypeInfo.getInfoFor(type);\n            if (info == null) {\n                throw new IllegalArgumentException(\n                        \"Type at position \" + i + \" is not a basic type.\");\n            }\n            infos[i] = info;\n        }\n\n        @SuppressWarnings(\"unchecked\")\n        TupleTypeInfo<X> tupleInfo = (TupleTypeInfo<X>) new TupleTypeInfo<Tuple>(infos);\n        return tupleInfo;\n    }\n\n    @SuppressWarnings(\"unchecked\")\n    @PublicEvolving\n    public static <X extends Tuple> TupleTypeInfo<X> getBasicAndBasicValueTupleTypeInfo(","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core/src/main/java/org/apache/flink/api/java/typeutils/TupleTypeInfo.java#L200-L236","documentation":"Thrown by TupleTypeInfo.getBasicTupleTypeInfo(Class<?>...) when an element of the varargs Class array is null. This is a plain IllegalArgumentException. The method constructs a TupleTypeInfo of basic types from the provided Class objects, so null is invalid.","triggerScenarios":"Calling TupleTypeInfo.getBasicTupleTypeInfo(String.class, null, Integer.class) — the second argument is null. The loop at line 216 checks each element and throws at position i.","commonSituations":"Programmatic tuple type construction where one Class reference came from an uninitialized variable, a failed Class.forName, or a list containing nulls. Rarely seen in declarative DataStream code.","solutions":["Remove or replace the null element in the Class varargs.","If building from a dynamic list, filter out nulls before calling."],"exampleFix":"// before\nTupleTypeInfo.getBasicTupleTypeInfo(String.class, null, Integer.class);\n// after\nTupleTypeInfo.getBasicTupleTypeInfo(String.class, Integer.class);","handlingStrategy":"validation","validationCode":"for (Class<?> c : basicTypes) {\n    if (c == null) {\n        throw new IllegalArgumentException(\n            \"Null type in array at position \" + i);\n    }\n}\nTupleTypeInfo.getBasicTupleTypeInfo(basicTypes);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Null-check all Class elements before calling getBasicTupleTypeInfo.","Initialize all Class references before use."],"tags":["tuple","null-check","type-system","factory-method","flink-core"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}