{"record":{"id":"7fed91c797c259fc","repo":"opendataloader-project/opendataloader-pdf","slug":"invalid-regionliststrategy-s-expected-table-fir","errorCode":null,"errorMessage":"Invalid regionlistStrategy: %s (expected table-first or list-only)","messagePattern":"Invalid regionlistStrategy: (.+?) \\(expected table-first or list-only\\)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"java/opendataloader-pdf-core/src/main/java/org/opendataloader/pdf/hybrid/HybridConfig.java","lineNumber":255,"sourceCode":"    public String getRegionlistStrategy() {\n        return regionlistStrategy;\n    }\n\n    /**\n     * Sets the regionlist strategy for label 7 (Table region) handling.\n     *\n     * <ul>\n     *   <li>{@code \"table-first\"} (default): check TSR overlap, skip if TSR exists, else treat as list</li>\n     *   <li>{@code \"list-only\"}: always treat as list, skip TSR check entirely</li>\n     * </ul>\n     *\n     * @param regionlistStrategy The regionlist strategy to use.\n     */\n    public void setRegionlistStrategy(String regionlistStrategy) {\n        if (regionlistStrategy != null\n                && !REGIONLIST_TABLE_FIRST.equals(regionlistStrategy)\n                && !REGIONLIST_LIST_ONLY.equals(regionlistStrategy)) {\n            throw new IllegalArgumentException(\"Invalid regionlistStrategy: \"\n                + regionlistStrategy + \" (expected \" + REGIONLIST_TABLE_FIRST\n                + \" or \" + REGIONLIST_LIST_ONLY + \")\");\n        }\n        this.regionlistStrategy = regionlistStrategy;\n    }\n\n    /**\n     * Checks if regionlist strategy is list-only (always treat label 7 as list).\n     *\n     * @return true if strategy is list-only, false otherwise.\n     */\n    public boolean isRegionlistListOnly() {\n        return REGIONLIST_LIST_ONLY.equals(regionlistStrategy);\n    }\n\n    /**\n     * Gets the page image cache strategy.\n     *","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/opendataloader-project/opendataloader-pdf/blob/a7789b8e77dd05e2b8659eb3ea12fc458f80bfb8/java/opendataloader-pdf-core/src/main/java/org/opendataloader/pdf/hybrid/HybridConfig.java#L237-L273","documentation":"HybridConfig.setRegionlistStrategy() accepts exactly two values: REGIONLIST_TABLE_FIRST ('table-first', the default) or REGIONLIST_LIST_ONLY ('list-only'). The strategy controls how label-7 (regionlist) regions are processed: 'table-first' checks table structure recognition (TSR) overlap first and skips list treatment if TSR exists, while 'list-only' always treats them as lists. Any other non-null value is rejected. Null is allowed (meaning 'use default').","triggerScenarios":"Calling config.setRegionlistStrategy('tableFirst'), config.setRegionlistStrategy('list_only'), or any variant with different casing, underscores, or typos. The check is case-sensitive — 'Table-First' or 'TABLE-FIRST' will fail.","commonSituations":"CLI flag `--regionlist-strategy table_first` (underscore instead of hyphen); config file using camelCase 'tableFirst'; copy-paste from documentation that used a different convention; trailing whitespace in a properties file value.","solutions":["Use exactly 'table-first' or 'list-only' (lowercase, hyphenated).","Pass null to keep the default ('table-first').","Check for trailing whitespace: trim the value before setting.","Use the constants: HybridConfig.REGIONLIST_TABLE_FIRST or HybridConfig.REGIONLIST_LIST_ONLY."],"exampleFix":"// before: underscore variant rejected\nconfig.setRegionlistStrategy(\"table_first\");\n\n// after: use the constant or exact string\nconfig.setRegionlistStrategy(HybridConfig.REGIONLIST_TABLE_FIRST);\n// or: config.setRegionlistStrategy(\"table-first\");","handlingStrategy":"validation","validationCode":"String strategy = configSource.get(\"regionlistStrategy\");\nSet<String> valid = Set.of(\n    HybridConfig.REGIONLIST_TABLE_FIRST,\n    HybridConfig.REGIONLIST_LIST_ONLY\n);\nif (strategy != null && !valid.contains(strategy)) {\n    throw new IllegalArgumentException(\n        \"Invalid regionlistStrategy '\" + strategy + \"'. Valid: \" + valid);\n}\nconfig.setRegionlistStrategy(strategy); // null = use default","typeGuard":"public static boolean isValidRegionlistStrategy(String strategy) {\n    return strategy == null\n        || HybridConfig.REGIONLIST_TABLE_FIRST.equals(strategy)\n        || HybridConfig.REGIONLIST_LIST_ONLY.equals(strategy);\n}","tryCatchPattern":"try {\n    config.setRegionlistStrategy(strategy);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"Invalid regionlistStrategy\")) {\n        // Use default instead of failing\n        config.setRegionlistStrategy(HybridConfig.REGIONLIST_TABLE_FIRST);\n        LOGGER.warning(\"Invalid regionlistStrategy, using default: table-first\");\n    } else {\n        throw e;\n    }\n}","preventionTips":["Trim whitespace from config file values before setting.","Use the public constants REGIONLIST_TABLE_FIRST and REGIONLIST_LIST_ONLY.","Remember: values are lowercase with hyphens ('table-first'), not underscores or camelCase.","Pass null to keep the default — do not pass empty string."],"tags":["configuration","validation","hybrid","regionlist","enum"],"backgroundTag":null,"analyzedSha":"a7789b8e77dd05e2b8659eb3ea12fc458f80bfb8","analyzedAt":"2026-08-14T05:22:03.953Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}