{"record":{"id":"2a1459bca82336a4","repo":"prestodb/presto","slug":"pad-must-not-be-in-alphabet-or-whitespace","errorCode":null,"errorMessage":"pad must not be in alphabet or whitespace","messagePattern":"pad must not be in alphabet or whitespace","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-common/src/main/java/com/facebook/presto/common/type/encoding/Base32.java","lineNumber":308,"sourceCode":"                throw new IllegalArgumentException(\"lineLength \" + lineLength + \" > 0, but lineSeparator is null\");\n            }\n            // Must be done after initializing the tables\n            if (containsAlphabetOrPad(lineSeparator)) {\n                final String sep = StringUtils.newStringUtf8(lineSeparator);\n                throw new IllegalArgumentException(\"lineSeparator must not contain Base32 characters: [\" + sep + \"]\");\n            }\n            this.encodeSize = BYTES_PER_ENCODED_BLOCK + lineSeparator.length;\n            this.lineSeparator = new byte[lineSeparator.length];\n            System.arraycopy(lineSeparator, 0, this.lineSeparator, 0, lineSeparator.length);\n        }\n        else {\n            this.encodeSize = BYTES_PER_ENCODED_BLOCK;\n            this.lineSeparator = null;\n        }\n        this.decodeSize = this.encodeSize - 1;\n\n        if (isInAlphabet(pad) || isWhiteSpace(pad)) {\n            throw new IllegalArgumentException(\"pad must not be in alphabet or whitespace\");\n        }\n    }\n\n    /**\n     * <p>\n     * Decodes all of the provided data, starting at inPos, for inAvail bytes. Should be called at least twice: once\n     * with the data to decode, and once with inAvail set to \"-1\" to alert decoder that EOF has been reached. The \"-1\"\n     * call is not necessary when decoding, but it doesn't hurt, either.\n     * </p>\n     * <p>\n     * Ignores all non-Base32 characters. This is how chunked (e.g. 76 character) data is handled, since CR and LF are\n     * silently ignored, but has implications for other bytes, too. This method subscribes to the garbage-in,\n     * garbage-out philosophy: it will not check the provided data for validity.\n     * </p>\n     *\n     * @param in byte[] array of ascii data to Base32 decode.\n     * @param inPos Position to start reading data from.\n     * @param inAvail Amount of bytes available from input for encoding.","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-common/src/main/java/com/facebook/presto/common/type/encoding/Base32.java#L290-L326","documentation":"Argument validation in the Base32 codec constructor: the configured padding byte (or a byte in the line separator overlap check) is also a member of the encoding alphabet or is whitespace. Because the pad character must be unambiguous for decode, the codec refuses the configuration at construction time.","triggerScenarios":"Thrown at presto-common/src/main/java/com/facebook/presto/common/type/encoding/Base32.java:308 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose a pad byte outside the alphabet and whitespace","Use the default '=' pad character"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}