{"record":{"id":"b5e09f69a7b82f4c","repo":"prestodb/presto","slug":"invalid-property-name-s","errorCode":null,"errorMessage":"Invalid property name '%s'","messagePattern":"Invalid property name '(.+?)'","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-spi/src/main/java/com/facebook/presto/spi/session/SessionPropertyMetadata.java","lineNumber":53,"sourceCode":"\n    private final boolean hidden;\n\n    @JsonCreator\n    public SessionPropertyMetadata(\n            @JsonProperty(\"name\") String name,\n            @JsonProperty(\"description\") String description,\n            @JsonProperty(\"typeSignature\") TypeSignature typeSignature,\n            @JsonProperty(\"defaultValue\") String defaultValue,\n            @JsonProperty(\"hidden\") boolean hidden)\n    {\n        this.name = requireNonNull(name, \"name is null\");\n        this.description = requireNonNull(description, \"description is null\");\n        this.typeSignature = requireNonNull(typeSignature, \"typeSignature is null\");\n        this.defaultValue = defaultValue;\n        this.hidden = hidden;\n\n        if (name.isEmpty() || !name.trim().toLowerCase(ENGLISH).equals(name)) {\n            throw new IllegalArgumentException(format(\"Invalid property name '%s'\", name));\n        }\n        if (description.isEmpty() || !description.trim().equals(description)) {\n            throw new IllegalArgumentException(format(\"Invalid property description '%s'\", description));\n        }\n    }\n\n    /**\n     * Name of the property.  This must be a valid identifier.\n     */\n    @JsonProperty\n    public String getName()\n    {\n        return name;\n    }\n\n    /**\n     * Description for the end user.\n     */","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-spi/src/main/java/com/facebook/presto/spi/session/SessionPropertyMetadata.java#L35-L71","documentation":"SessionPropertyMetadata validates session property names in its constructor. A name must be non-empty and already lowercased with no leading/trailing whitespace. This check keeps property identifiers canonical so they can be matched against SET/RESET SESSION statements.","triggerScenarios":"Calling the SessionPropertyMetadata constructor (directly or via builder) with an empty name, a name containing uppercase letters, or surrounding whitespace, e.g. new SessionPropertyMetadata(\"MyProp\", ...).","commonSituations":"Plugin/connector authors defining system or catalog session properties with camelCase or mixed-case names, or copying property names from UIs/logs that picked up trailing spaces.","solutions":["Rename the property to all-lowercase (e.g. 'myprop')","Trim the name string before constructing the metadata","Ensure the name is not empty before constructing","Apply String.toLowerCase(ENGLISH).trim() to the value passed in"],"exampleFix":"// before\nnew SessionPropertyMetadata(\"MaxSplits\", ...\n// after\nnew SessionPropertyMetadata(\"max_splits\", ...","handlingStrategy":"validation","validationCode":"if (name == null || name.isEmpty() || !name.trim().toLowerCase(Locale.ENGLISH).equals(name)) { throw new IllegalArgumentException(\"property name must be non-empty lowercase, got: \" + name); }","typeGuard":"boolean isValidPropertyName(String name) { return name != null && !name.isEmpty() && name.trim().toLowerCase(Locale.ENGLISH).equals(name); }","tryCatchPattern":null,"preventionTips":["Always define session property names in lowercase snake_case","Trim strings sourced from config files or environment variables","Add a unit test asserting each property metadata can be constructed"],"tags":["spi","session-properties","validation","plugin"],"backgroundTag":"invalid-identifier-name","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"}