{"record":{"id":"3c14073464d588db","repo":"t8y2/dbx","slug":"unsupported-object-type-objecttype-3c1407","errorCode":null,"errorMessage":"Unsupported object type: \" + objectType","messagePattern":"Unsupported object type: \" \\+ objectType","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"agents/drivers/yashandb/src/main/java/com/dbx/agent/yashandb/YashandbAgent.java","lineNumber":138,"sourceCode":"                    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":120,"sourceCodeEnd":147,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/yashandb/src/main/java/com/dbx/agent/yashandb/YashandbAgent.java#L120-L147","documentation":"After the null check, YashanDB's normalizeObjectSourceType trims/uppercases the type and accepts only \"FUNCTION\" or \"PROCEDURE\" — the only object kinds whose source YashanDB can return. All other non-null values throw IllegalArgumentException with the original input embedded in the message.","triggerScenarios":"Calling normalizedType/getObjectSource with any type other than FUNCTION or PROCEDURE — e.g. \"VIEW\", \"TRIGGER\", \"SEQUENCE\", \"PACKAGE\", or unnormalized variants like \"procedure \" that would be fine after trim (handled) but \"PACKAGE\" or synonyms are not.","commonSituations":"Shared UI code written for Oracle-compatible drivers offers 'view source' on all object kinds; a metadata listing includes views/triggers and the explorer requests source for each; types are passed from config or user input without restricting to functions/procedures.","solutions":["Request source only for FUNCTION and PROCEDURE objects on YashanDB.","Pre-filter in the caller: only invoke when \"FUNCTION\".equals(t) || \"PROCEDURE\".equals(t) after trim/uppercase.","Render a 'source not supported for this object type' state in the UI for other kinds instead of calling the API."],"exampleFix":"// before\nvar src = agent.getObjectSource(schema, name, \"VIEW\"); // throws\n// after\nString t = type == null ? \"\" : type.trim().toUpperCase(Locale.ROOT);\nif (t.equals(\"FUNCTION\") || t.equals(\"PROCEDURE\")) {\n    var src = agent.getObjectSource(schema, name, t);\n}","handlingStrategy":"validation","validationCode":"String t = objectType == null ? \"\" : objectType.trim().toUpperCase(Locale.ROOT);\nif (!t.equals(\"FUNCTION\") && !t.equals(\"PROCEDURE\")) {\n    // skip: YashanDB supports source only for functions and procedures\n}","typeGuard":"boolean yashandbSupportsSource(String t) {\n    if (t == null) return false;\n    String n = t.trim().toUpperCase(Locale.ROOT);\n    return n.equals(\"FUNCTION\") || n.equals(\"PROCEDURE\");\n}","tryCatchPattern":"try {\n    source = agent.getObjectSource(schema, name, type);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Unsupported object type\")) {\n        source = \"\"; // render 'source not available'\n    } else throw e;\n}","preventionTips":["Restrict YashanDB source retrieval to FUNCTION and PROCEDURE objects in the UI.","Trim/uppercase the type on the client side to match normalization.","For views/triggers, display metadata only rather than attempting source retrieval."],"tags":["yashandb","validation","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"}