{"record":{"id":"c74032daa4d7e95f","repo":"prestodb/presto","slug":"catalogname-is-empty","errorCode":null,"errorMessage":"catalogName is empty","messagePattern":"catalogName is empty","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-spi/src/main/java/com/facebook/presto/spi/ConnectorId.java","lineNumber":40,"sourceCode":"import java.util.Objects;\n\nimport static java.util.Objects.requireNonNull;\n\n@ThriftStruct\npublic final class ConnectorId\n{\n    private static final String INFORMATION_SCHEMA_CONNECTOR_PREFIX = \"$info_schema@\";\n    private static final String SYSTEM_TABLES_CONNECTOR_PREFIX = \"$system@\";\n\n    private final String catalogName;\n\n    @ThriftConstructor\n    @JsonCreator\n    public ConnectorId(String catalogName)\n    {\n        this.catalogName = requireNonNull(catalogName, \"catalogName is null\");\n        if (catalogName.isEmpty()) {\n            throw new IllegalArgumentException(\"catalogName is empty\");\n        }\n    }\n\n    @ThriftField(1)\n    public String getCatalogName()\n    {\n        return catalogName;\n    }\n\n    @Override\n    public boolean equals(Object o)\n    {\n        if (this == o) {\n            return true;\n        }\n        if (o == null || getClass() != o.getClass()) {\n            return false;\n        }","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-spi/src/main/java/com/facebook/presto/spi/ConnectorId.java#L22-L58","documentation":"ConnectorId is the typed identifier for a catalog in Presto. Its constructor performs validation: a null name fails requireNonNull and an empty string is rejected with this IllegalArgumentException, since catalogs must have non-empty names.","triggerScenarios":"Constructing new ConnectorId(\"\") or passing an empty catalog name string, typically derived from an empty config key, catalog name parsing, or metadata lookups.","commonSituations":"Catalog property file present but catalog name parsed as empty; calling catalog APIs with an empty string from user input or environment variables; misconfigured ConnectorName in properties.","solutions":["Pass a non-empty catalog name to ConnectorId","Check where the name string is built (config keys, path names) for empty values","Validate the catalog name before constructing ConnectorId"],"exampleFix":"// before\nConnectorId id = new ConnectorId(catalogName); // \"\"\n// after\nif (catalogName != null && !catalogName.isEmpty()) {\n    ConnectorId id = new ConnectorId(catalogName);\n}","handlingStrategy":"type-guard","validationCode":"if (catalogName == null || catalogName.isEmpty()) throw new IllegalArgumentException(\"catalogName must be non-empty\");","typeGuard":"boolean isValidConnectorId(String s) { return s != null && !s.isEmpty(); }","tryCatchPattern":"try { ConnectorId id = new ConnectorId(name); } catch (IllegalArgumentException e) { /* fall back to default catalog or surface config error */ }","preventionTips":["Validate catalog names parsed from config/paths before constructing ConnectorId","Trim and check names sourced from user input or environment","Use CatalogName abstractions early so emptiness fails at parse time"],"tags":["presto","spi","validation","catalog"],"backgroundTag":"invalid-identifier","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}