{"record":{"id":"da35e468fee1e6ab","repo":"oracle/graal","slug":"jdwp-options-must-be-a-comma-separated-list-of-key","errorCode":null,"errorMessage":"JDWP options must be a comma separated list of key=value pairs.","messagePattern":"JDWP options must be a comma separated list of key=value pairs\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/EspressoOptions.java","lineNumber":417,"sourceCode":"            if (!\"y\".equals(value) && !\"n\".equals(value)) {\n                throw new IllegalArgumentException(\"Invalid JDWP option value: \" + key + \" can be only 'y' or 'n'.\");\n            }\n            return \"y\".equals(value);\n        }\n\n        @Override\n        public JDWPOptions apply(String s) {\n            final String[] options = s.split(\",\");\n            String transport = null;\n            String host = null;\n            int port = 0;\n            boolean server = false;\n            boolean suspend = true;\n\n            for (String keyValue : options) {\n                int equalsIndex = keyValue.indexOf('=');\n                if (equalsIndex <= 0) {\n                    throw new IllegalArgumentException(\"JDWP options must be a comma separated list of key=value pairs.\");\n                }\n                String key = keyValue.substring(0, equalsIndex);\n                String value = keyValue.substring(equalsIndex + 1);\n                switch (key) {\n                    case \"address\":\n                        String inputHost = null;\n                        int inputPort = 0;\n                        if (!value.isEmpty()) {\n                            int colonIndex = value.indexOf(':');\n                            if (colonIndex > 0) {\n                                inputHost = value.substring(0, colonIndex);\n                            }\n                            String portStr = value.substring(colonIndex + 1);\n                            long realValue;\n                            try {\n                                realValue = Long.valueOf(portStr);\n                                if (realValue < 0 || realValue > 65535) {\n                                    throw new IllegalArgumentException(\"Invalid JDWP option, address: \" + value + \". Must be in the 0 - 65535 range.\");","sourceCodeStart":399,"sourceCodeEnd":435,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/EspressoOptions.java#L399-L435","documentation":"The JDWPOptions converter splits the option value on commas and requires each token to contain '=' at index > 0 (a non-empty key followed by a value). A token without '=', or starting with '=' (empty key), fails this check.","triggerScenarios":"Passing --java.JDWPOptions=transport=dt_socket;server=y (semicolon separators), a trailing comma, a bare flag like 'suspend', or a leading '='.","commonSituations":"Shell quoting mistakes that eat the '='; using ';' or space separators as some JDWP docs show; trailing commas from programmatically joining an option list.","solutions":["Ensure every token is key=value separated by commas: transport=dt_socket,server=y,suspend=n.","Remove trailing/leading commas and bare flags.","Quote the whole option in the shell to prevent word splitting."],"exampleFix":"# before\n--java.JDWPOptions=transport=dt_socket,server=y,\n\n# after\n--java.JDWPOptions=transport=dt_socket,server=y","handlingStrategy":"validation","validationCode":"for (String kv : opts.split(\",\", -1)) {\n    int i = kv.indexOf('=');\n    if (i <= 0 || kv.substring(i + 1).isEmpty() && !kv.endsWith(\"=\")) {\n        // strict check: key non-empty, '=' present\n    }\n    if (i <= 0) throw new ConfigException(\"Malformed JDWP token: \" + kv);\n}","typeGuard":"static boolean wellFormedJdwp(String s) {\n    for (String kv : s.split(\",\", -1)) {\n        int i = kv.indexOf('=');\n        if (i <= 0) return false;\n    }\n    return true;\n}","tryCatchPattern":null,"preventionTips":["Build JDWP strings by joining a validated key=value map instead of string concatenation.","Quote the whole value in shell scripts.","Beware trailing commas when removing options by hand."],"tags":["espresso","graalvm","jdwp","debugging","configuration"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}