{"record":{"id":"2f1c172c6142f84e","repo":"t8y2/dbx","slug":"unsupported-object-type-objecttype-2f1c17","errorCode":null,"errorMessage":"Unsupported object type: \" + objectType","messagePattern":"Unsupported object type: \" \\+ objectType","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java","lineNumber":209,"sourceCode":"                try (ResultSet rs = stmt.executeQuery()) {\n                    while (rs.next()) {\n                        result.add(new ObjectInfo(rs.getString(\"OBJECT_NAME\"), normalizeTableType(rs.getString(\"OBJECT_TYPE\")), schema, emptyToNull(rs.getString(\"OBJECT_COMMENT\"))));\n                    }\n                }\n            }\n            return constraints.withoutPaging().filterObjects(result);\n        });\n    }\n\n    @Override\n    public ObjectSource getObjectSource(String schema, String name, String objectType) {\n        return unchecked(() -> {\n            String quotedName = JdbcIdentifiers.INSTANCE.backtick(name);\n            String sql = switch (objectType.toUpperCase(Locale.ROOT)) {\n                case \"VIEW\" -> \"SHOW CREATE VIEW \" + quotedName;\n                case \"PROCEDURE\" -> \"SHOW CREATE PROCEDURE \" + quotedName;\n                case \"FUNCTION\" -> \"SHOW CREATE FUNCTION \" + quotedName;\n                default -> throw new IllegalArgumentException(\"Unsupported object type: \" + objectType);\n            };\n\n            String source = \"\";\n            try (java.sql.Statement stmt = requireConnected().createStatement();\n                 ResultSet rs = stmt.executeQuery(sql)) {\n                if (rs.next()) {\n                    int sourceIndex = \"VIEW\".equals(objectType.toUpperCase(Locale.ROOT)) ? 2 : 3;\n                    String value = rs.getString(sourceIndex);\n                    source = value == null ? \"\" : value;\n                }\n            }\n            return new ObjectSource(name, objectType, schema, source);\n        });\n    }\n\n    @Override\n    public List<ColumnInfo> getColumns(String schema, String table) {\n        return unchecked(() -> {","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/goldendb/src/main/java/com/dbx/agent/goldendb/GoldendbAgent.java#L191-L227","documentation":"GoldendbAgent.getObjectSource builds a SHOW CREATE statement from the object type; only VIEW, PROCEDURE, and FUNCTION are accepted. Any other type reaches the switch default and throws IllegalArgumentException naming the offending type. Note the input is upper-cased but not trimmed.","triggerScenarios":"Calling getObjectSource with a type such as 'TABLE', 'TRIGGER', 'EVENT', or an untrimmed string; null type would also NPE here at objectType.toUpperCase.","commonSituations":"Passing metadata-derived types for tables; UI labels with trailing spaces; drivers shared across database flavors where more object kinds are legal elsewhere.","solutions":["Pass only VIEW, PROCEDURE, or FUNCTION (case-insensitive)","Trim and normalize the type string before calling","Route other object kinds to dedicated DDL APIs"],"exampleFix":"// before\nagent.getObjectSource(schema, name, objectType); // \"table\"\n// after\nString t = objectType == null ? null : objectType.trim();\nif (t != null && List.of(\"VIEW\",\"PROCEDURE\",\"FUNCTION\").contains(t.toUpperCase(Locale.ROOT))) {\n    agent.getObjectSource(schema, name, t);\n} else {\n    throw new IllegalArgumentException(\"GoldenDB source supports only VIEW/PROCEDURE/FUNCTION\");\n}","handlingStrategy":"validation","validationCode":"if (objectType == null) throw new IllegalArgumentException(\"objectType required\"); String t = objectType.trim().toUpperCase(Locale.ROOT); if (!List.of(\"VIEW\",\"PROCEDURE\",\"FUNCTION\").contains(t)) throw new IllegalArgumentException(\"GoldenDB source supports only VIEW/PROCEDURE/FUNCTION\");","typeGuard":"static boolean isSupportedGoldendbObjectType(String t) { return t != null && List.of(\"VIEW\",\"PROCEDURE\",\"FUNCTION\").contains(t.trim().toUpperCase(Locale.ROOT)); }","tryCatchPattern":"try { src = agent.getObjectSource(schema, name, type); } catch (IllegalArgumentException e) { log.warn(\"Unsupported GoldenDB object type: {}\", type); return null; }","preventionTips":["Trim before calling — the driver does not trim the type input","Route tables/triggers to dedicated DDL APIs","Never pass null type; it would NPE at toUpperCase before the switch"],"tags":["goldendb","unsupported-object-type","argument-validation","ddl"],"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"}