{"record":{"id":"d4b9b8e4859b2621","repo":"dbeaver/dbeaver","slug":"no-suitable-dataexporterarrayformat-found","errorCode":null,"errorMessage":"No suitable DataExporterArrayFormat found","messagePattern":"No suitable DataExporterArrayFormat found","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"plugins/org.jkiss.dbeaver.data.transfer/src/org/jkiss/dbeaver/tools/transfer/stream/exporter/DataExporterArrayFormat.java","lineNumber":39,"sourceCode":"    CURLY_BRACKETS('{', '}'),\n    BRACKETS('(', ')');\n\n    private char prefix;\n    private char suffix;\n\n    DataExporterArrayFormat(char prefix, char suffix) {\n        this.prefix = prefix;\n        this.suffix = suffix;\n    }\n\n    public static DataExporterArrayFormat getArrayFormat(String bracketPair) {\n        for (DataExporterArrayFormat df : DataExporterArrayFormat.values()) {\n            bracketPair = bracketPair.trim();\n            if (bracketPair.charAt(0) == df.prefix && bracketPair.charAt(bracketPair.length() - 1) == df.suffix) {\n                return df;\n            }\n        }\n        throw new IllegalStateException(\"No suitable DataExporterArrayFormat found\");\n    }\n\n    public static DataExporterArrayFormat getArrayFormatOnPrefix(char prefix) {\n        for (DataExporterArrayFormat df : DataExporterArrayFormat.values()) {\n            if (prefix == df.prefix) {\n                return df;\n            }\n        }\n        return CURLY_BRACKETS;\n    }\n\n    public char getPrefix() {\n        return prefix;\n    }\n\n    public char getSuffix() {\n        return suffix;\n    }","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/dbeaver/dbeaver/blob/1e5ee1042bc61661368942aece126f3e67049955/plugins/org.jkiss.dbeaver.data.transfer/src/org/jkiss/dbeaver/tools/transfer/stream/exporter/DataExporterArrayFormat.java#L21-L57","documentation":"Thrown by DataExporterArrayFormat.getArrayFormat(String) when no enum constant matches the supplied bracket pair. The enum only supports [], {}, and (). It compares the first char against each prefix and the last char against each suffix; if none match it throws IllegalStateException (an unchecked exception).","triggerScenarios":"getArrayFormat(bracketPair) is called with a string whose first/last characters are not one of [ ], { }, ( ). The loop finds no match and throws new IllegalStateException(\"No suitable DataExporterArrayFormat found\").","commonSituations":"User or config supplied a custom bracket pair like <> or \"\" or an empty/whitespace string; a malformed array-format property in the exporter settings; copy-paste of an unsupported delimiter.","solutions":["Use one of the supported pairs: [], {}, or ().","Trim/validate the bracket-pair string before passing it to getArrayFormat.","Prefer getArrayFormatOnPrefix(char) which defaults to CURLY_BRACKETS instead of throwing.","If a custom pair is required, extend the enum or handle the format outside this helper."],"exampleFix":"// before\nDataExporterArrayFormat fmt = DataExporterArrayFormat.getArrayFormat(userInput);\n// after: validate against the known set first\nString pair = userInput.trim();\nif (pair.length() < 2 || \"[]{}()\".indexOf(pair.charAt(0)) < 0) {\n    fmt = DataExporterArrayFormat.CURLY_BRACKETS; // safe default\n} else {\n    fmt = DataExporterArrayFormat.getArrayFormat(pair);\n}","handlingStrategy":"type-guard","validationCode":"String pair = bracketPair == null ? \"\" : bracketPair.trim();\nboolean ok = pair.length() >= 2 && switch (pair.charAt(0) + \"\" + pair.charAt(pair.length()-1)) {\n    case \"[]\", \"{}\", \"()\" -> true; default -> false;\n};\nif (!ok) throw new IllegalArgumentException(\"Unsupported bracket pair: \" + pair);","typeGuard":"static boolean isSupportedBracketPair(String p) {\n    if (p == null) return false;\n    p = p.trim();\n    return p.length() >= 2 && (p.startsWith(\"[\") && p.endsWith(\"]\")\n        || p.startsWith(\"{\") && p.endsWith(\"}\")\n        || p.startsWith(\"(\") && p.endsWith(\")\"));\n}","tryCatchPattern":"try {\n    fmt = DataExporterArrayFormat.getArrayFormat(userInput);\n} catch (IllegalStateException e) {\n    fmt = DataExporterArrayFormat.CURLY_BRACKETS; // safe default\n    log.warn(\"Unsupported bracket pair, defaulting to {}\", e);\n}","preventionTips":["Restrict user input to [], {}, ().","Prefer getArrayFormatOnPrefix which never throws.","Validate the bracket-pair string before calling getArrayFormat."],"tags":["data-transfer","exporter","csv","array-format","configuration","unchecked"],"backgroundTag":null,"analyzedSha":"1e5ee1042bc61661368942aece126f3e67049955","analyzedAt":"2026-08-13T23:31:13.467Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}