{"record":{"id":"3da601259b179185","repo":"prestodb/presto","slug":"linelength-linelength-0-but-lineseparator-is","errorCode":null,"errorMessage":"lineLength {lineLength} > 0, but lineSeparator is null","messagePattern":"lineLength (.+?) > 0, but lineSeparator is null","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-common/src/main/java/com/facebook/presto/common/type/encoding/Base32.java","lineNumber":290,"sourceCode":"     * @param pad byte used as padding byte.\n     * @throws IllegalArgumentException The provided lineSeparator included some Base32 characters. That's not going to work! Or the\n     * lineLength &gt; 0 and lineSeparator is null.\n     */\n    public Base32(final int lineLength, final byte[] lineSeparator, final boolean useHex, final byte pad)\n    {\n        super(BYTES_PER_ENCODED_BLOCK, lineLength,\n                lineSeparator == null ? 0 : lineSeparator.length, pad);\n        if (useHex) {\n            this.encodeTable = HEX_ENCODE_TABLE;\n            this.decodeTable = HEX_DECODE_TABLE;\n        }\n        else {\n            this.encodeTable = ENCODE_TABLE;\n            this.decodeTable = DECODE_TABLE;\n        }\n        if (lineLength > 0) {\n            if (lineSeparator == null) {\n                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\");","sourceCodeStart":272,"sourceCodeEnd":308,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-common/src/main/java/com/facebook/presto/common/type/encoding/Base32.java#L272-L308","documentation":"Base32(lineLength, lineSeparator, ...) constructor guard: a positive lineLength requests wrapped output lines, but no line separator bytes were supplied, so wrapping is impossible and construction is rejected.","triggerScenarios":"Thrown at presto-common/src/main/java/com/facebook/presto/common/type/encoding/Base32.java:290 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a non-null lineSeparator when lineLength > 0","Set lineLength to 0 if unchunked single-line output is wanted"],"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"}