{"record":{"id":"d1202b4900eb5cf6","repo":"opendataloader-project/opendataloader-pdf","slug":"unsupported-table-method-s-supported-values","errorCode":null,"errorMessage":"Unsupported table method '%s'. Supported values: %s","messagePattern":"Unsupported table method '(.+?)'\\. Supported values: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"java/opendataloader-pdf-core/src/main/java/org/opendataloader/pdf/api/Config.java","lineNumber":425,"sourceCode":"\n    /**\n     * Gets the table detection method.\n     *\n     * @return The table detection method (default or cluster).\n     */\n    public String getTableMethod() {\n        return tableMethod;\n    }\n\n    /**\n     * Sets the table detection method.\n     *\n     * @param tableMethod The table detection method (default or cluster).\n     * @throws IllegalArgumentException if the method is not supported.\n     */\n    public void setTableMethod(String tableMethod) {\n        if (tableMethod != null && !isValidTableMethod(tableMethod)) {\n            throw new IllegalArgumentException(\n                String.format(\"Unsupported table method '%s'. Supported values: %s\",\n                    tableMethod, getTableMethodOptions(\", \")));\n        }\n        this.tableMethod = tableMethod != null ? tableMethod.toLowerCase(Locale.ROOT) : TABLE_METHOD_DEFAULT;\n    }\n\n    /**\n     * Gets the list of methods of table detection.\n     *\n     * @param delimiter the delimiter to use between options\n     * @return the string with methods separated by the delimiter\n     */\n    public static String getTableMethodOptions(CharSequence delimiter) {\n        return String.join(delimiter, tableMethodOptions);\n    }\n\n    /**\n     * Checks if the given table method is valid.","sourceCodeStart":407,"sourceCodeEnd":443,"githubUrl":"https://github.com/opendataloader-project/opendataloader-pdf/blob/a7789b8e77dd05e2b8659eb3ea12fc458f80bfb8/java/opendataloader-pdf-core/src/main/java/org/opendataloader/pdf/api/Config.java#L407-L443","documentation":"Config.setTableMethod rejects any value not in the registered table-method set {default, cluster}. Validation is case-insensitive (the input is lowercased before the contains check), but the setter does NOT trim whitespace, so a value like \" cluster\" fails. null is accepted and falls back to the default. IllegalArgumentException is thrown before the field is assigned.","triggerScenarios":"config.setTableMethod(\"fast\") or CLI --table-method foo. Also fires for untrimmed whitespace-padded values coming from an external JSON/env source.","commonSituations":"Typo at the command line; value read from a config file written for a different library version; copy-paste of a value name from a different tool; trailing whitespace from templated config injection.","solutions":["Use one of the supported values: default or cluster.","Trim values sourced from files/env before passing: setTableMethod(value.trim()).","Pre-validate with Config.isValidTableMethod(value) before calling setTableMethod."],"exampleFix":"// before: config.setTableMethod(\"fast\");\n// after:  config.setTableMethod(\"cluster\");","handlingStrategy":"validation","validationCode":"String method = externalValue == null ? null : externalValue.trim();\nif (method != null && !Config.isValidTableMethod(method)) {\n    throw new IllegalArgumentException(\n        \"Bad --table-method '\" + method + \"'. Valid: \" + Config.getTableMethodOptions(\", \"));\n}\nconfig.setTableMethod(method);","typeGuard":"static boolean isSupportedTableMethod(String s) {\n    return s != null && Config.isValidTableMethod(s.trim());\n}","tryCatchPattern":"try {\n    config.setTableMethod(raw);\n} catch (IllegalArgumentException e) {\n    // fall back to default, or report to the user with getTableMethodOptions(\", \")\n    config.setTableMethod(null);\n}","preventionTips":["Always trim values coming from env/config files before passing to setters.","Prefer the isValid* static validators over try/catch for user-facing input.","Drive allowed values from the library's own getXxxOptions(...) so you never drift from the registered set."],"tags":["configuration","validation","table-detection"],"backgroundTag":null,"analyzedSha":"a7789b8e77dd05e2b8659eb3ea12fc458f80bfb8","analyzedAt":"2026-08-14T05:22:03.953Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}