{"record":{"id":"9d221a96ba40fbce","repo":"t8y2/dbx","slug":"unsupported-object-type-null-9d221a","errorCode":null,"errorMessage":"Unsupported object type: null","messagePattern":"Unsupported object type: null","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"agents/drivers/yashandb/src/main/java/com/dbx/agent/yashandb/YashandbAgent.java","lineNumber":134,"sourceCode":"                statement.setString(1, schema);\n                statement.setString(2, name);\n                statement.setString(3, normalizedObjectType);\n                try (ResultSet resultSet = statement.executeQuery()) {\n                    while (resultSet.next()) {\n                        String line = resultSet.getString(1);\n                        if (line != null) {\n                            source.append(line);\n                        }\n                    }\n                }\n            }\n            return new ObjectSource(name, normalizedObjectType, schema, source.toString(), false);\n        });\n    }\n\n    static String normalizeObjectSourceType(String objectType) {\n        if (objectType == null) {\n            throw new IllegalArgumentException(\"Unsupported object type: null\");\n        }\n        String normalized = objectType.trim().toUpperCase(Locale.ROOT);\n        if (!\"FUNCTION\".equals(normalized) && !\"PROCEDURE\".equals(normalized)) {\n            throw new IllegalArgumentException(\"Unsupported object type: \" + objectType);\n        }\n        return normalized;\n    }\n\n    public static void main(String[] args) {\n        new MultiSessionJsonRpcServer(YashandbAgent::new).run();\n    }\n}\n","sourceCodeStart":116,"sourceCodeEnd":147,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/yashandb/src/main/java/com/dbx/agent/yashandb/YashandbAgent.java#L116-L147","documentation":"YashanDB's normalizeObjectSourceType rejects a null objectType with a distinct message (\"Unsupported object type: null\") before normalization runs. YashanDB only supports FUNCTION and PROCEDURE source retrieval, so a null type can never be valid and is reported explicitly to distinguish it from merely unsupported non-null values.","triggerScenarios":"Calling normalizeObjectSourceType (via normalizedObjectType / getObjectSource) with objectType == null — typically when the metadata row's TYPE/OBJECT_TYPE column was NULL or the caller dropped the field.","commonSituations":"Dictionary queries return rows (e.g. indexes, sequences) whose type column is null; a UI passes through an unpopulated combo-box value; JSON payloads omit the type field and it deserializes to null.","solutions":["Ensure the caller supplies a real type string; default null to a sensible value or skip the object in the caller.","Coalesce: normalizeObjectSourceType(objectType == null ? \"\" : objectType) only if downstream should report the normal unsupported-type message instead.","Fix the metadata query so TYPE is never null for rows sent to source retrieval."],"exampleFix":"// before\nString t = normalizeObjectSourceType(row.getString(\"OBJECT_TYPE\")); // NPE-prone null\n// after\nString raw = row.getString(\"OBJECT_TYPE\");\nif (raw == null) { skip(row); return; }\nString t = normalizeObjectSourceType(raw);","handlingStrategy":"type-guard","validationCode":"if (objectType == null) {\n    // skip or default before calling normalizeObjectSourceType\n}","typeGuard":"Optional<String> safeType(String t) {\n    if (t == null) return Optional.empty();\n    String n = t.trim().toUpperCase(Locale.ROOT);\n    return (n.equals(\"FUNCTION\") || n.equals(\"PROCEDURE\")) ? Optional.of(n) : Optional.empty();\n}","tryCatchPattern":"try {\n    type = normalizeObjectSourceType(rawType);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().endsWith(\": null\")) {\n        log.warn(\"Missing object type; skipping source retrieval\");\n        return;\n    }\n    throw e;\n}","preventionTips":["Null-check metadata TYPE columns before requesting source.","Configure JSON deserialization to flag missing type fields instead of silently passing null.","Skip catalog rows with null types in the metadata query (WHERE OBJECT_TYPE IS NOT NULL)."],"tags":["yashandb","null-check","unsupported-type"],"backgroundTag":"unsupported-object-type","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}