{"record":{"id":"059a9a1de2b9b75e","repo":"t8y2/dbx","slug":"unsupported-object-type-null","errorCode":null,"errorMessage":"Unsupported object type: null","messagePattern":"Unsupported object type: null","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"agents/drivers/firebird/src/main/java/com/dbx/agent/firebird/FirebirdAgent.java","lineNumber":123,"sourceCode":"                        } else if (parameterType == 1) {\n                            outputs.add(parameter);\n                        } else {\n                            throw new IllegalStateException(\"Unsupported Firebird parameter type: \" + parameterType);\n                        }\n                    }\n                }\n            }\n\n            String source = !found || body == null || body.isBlank()\n                ? \"\"\n                : buildProcedureDdl(name, inputs, outputs, body);\n            return new ObjectSource(name, normalizedType, schema, source, 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 (!\"PROCEDURE\".equals(normalized)) {\n            throw new IllegalArgumentException(\"Unsupported object type: \" + objectType);\n        }\n        return normalized;\n    }\n\n    private static String buildProcedureDdl(\n        String name,\n        List<ProcedureParameter> inputs,\n        List<ProcedureParameter> outputs,\n        String body\n    ) {\n        StringBuilder ddl = new StringBuilder(\"CREATE OR ALTER PROCEDURE \")\n            .append(quoteIdentifier(name));\n        appendParameterBlock(ddl, inputs, \" (\");\n        if (inputs.isEmpty()) {","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/firebird/src/main/java/com/dbx/agent/firebird/FirebirdAgent.java#L105-L141","documentation":"FirebirdAgent.normalizeObjectSourceType only supports \"PROCEDURE\"; a null object type cannot be normalized, so it throws IllegalArgumentException immediately. The check exists so the agent never silently treats an unknown object kind as a procedure.","triggerScenarios":"Calling getObjectSource (or normalizedType) on Firebird with objectType == null; also thrown when a non-null type trims/uppercases to something other than PROCEDURE.","commonSituations":"Object type coming from an upstream catalog where the type column is NULL for Firebird; callers passing \"TABLE\" or \"FUNCTION\" instead of the only supported \"PROCEDURE\"; lowercase or whitespace variants that would otherwise work but are null-checked first.","solutions":["Pass objectType = \"PROCEDURE\" explicitly — Firebird in this driver only supports procedures.","Handle null upstream: default or skip objects whose type is unknown before calling getObjectSource.","If the object really is a table/function, use the appropriate agent/API instead of the Firebird procedure source path.","Trim and uppercase the type value on your side before the call if it comes from external metadata."],"exampleFix":"// before\nagent.getObjectSource(conn, schema, name, row.getObjectType()); // may be null\n// after\nString type = row.getObjectType();\nif (type == null || !type.trim().equalsIgnoreCase(\"PROCEDURE\")) return; // skip unsupported\nagent.getObjectSource(conn, schema, name, type);","handlingStrategy":"type-guard","validationCode":"// Java (caller side)\nif (objectType == null || !objectType.trim().equalsIgnoreCase(\"PROCEDURE\")) {\n    return Optional.empty(); // Firebird agent only supports procedures\n}","typeGuard":"// Java narrowing helper\nstatic boolean isProcedure(String objectType) {\n    return objectType != null && \"PROCEDURE\".equals(objectType.trim().toUpperCase(Locale.ROOT));\n}\nif (isProcedure(objectType)) {\n    src = agent.getObjectSource(conn, schema, name, objectType);\n}","tryCatchPattern":"try {\n    src = agent.getObjectSource(conn, schema, name, objectType);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"Unsupported object type\")) {\n        LOG.debug(\"Skipping Firebird object {} of type {}\", name, objectType);\n    } else { throw e; }\n}","preventionTips":["Only pass \"PROCEDURE\" to the Firebird agent — it is the sole supported object type.","Filter null object types from upstream catalog rows before requesting sources.","Normalize type strings (trim + uppercase) at the boundary of your code.","Route table/view/function extraction to the appropriate driver agent instead of FirebirdAgent."],"tags":["validation","firebird","null-argument"],"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-14T00:17:10.932Z"}